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 類方法的相關內容,多看幾篇博客教程相信你會對它有更好的理解
- 1 回答
- 0 關注
- 1070 瀏覽
添加回答
舉報
0/150
提交
取消