亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么xcode的方法前面會有+-號?

為什么xcode的方法前面會有+-號?

iOS
牧羊人nacy 2018-10-24 14:06:38
xcode經常有一些函數前面有+-號。請問這是什么意思?怎么用?謝謝!本小白不勝感激!比如:- (void)applicationDidEnterBackground:(UIApplication *)application{// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.//This means the application has been terminated}+ (NSParagraphStyle *)defaultParagraphStyle;+ (NSWritingDirection)defaultWritingDirectionForLanguage:(NSString *)languageName; // languageName is in ISO lang region format
查看完整描述

1 回答

?
慕村225694

TA貢獻1880條經驗 獲得超4個贊

+方法即類方法
類方法是屬于類對象的,所以無需創建類的實例對象我們就可以直接使用它們。使用形式為:
[ClassName classMethod];
對此你可以搜索一下Objective-C 類方法的相關內容,多看幾篇博客教程相信你會對它有更好的理解

查看完整回答
反對 回復 2018-11-15
  • 1 回答
  • 0 關注
  • 1070 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號