小编wei*_*wei的帖子

自定义Xcode片段库

感谢您阅读我的问题.

我想自定义我的Xcode片段库.

我读过这篇文章. http://www.icodeblog.com/2011/12/06/using-xcode-4-snippets/

现在我想自定义我的评论,在评论文本后自动插入日期(今天).

例如:

//This is my comment --- 2012/05/15
Run Code Online (Sandbox Code Playgroud)

日期(2012/05/15)由Xcode自动生成.

这可能吗?

PS我的Xcode版本是4.3.2

谢谢.

xcode comments date code-snippets

7
推荐指数
1
解决办法
501
查看次数

@property保留或复制

首先我读了这篇文章

我想我应该在我的程序中使用"复制".问题是使用NSMutableDictionary复制它会终止.

*****由于未捕获异常'NSInternalInconsistencyException'而终止应用程序,原因:' - [__ NSCFDictionary removeAllObjects]:发送到不可变对象的变异方法'**

我不知道"发送到不可变对象的变异方法".我没有将NSDictionary设置为NSMutabledictionary指针.

这是我的代码



.h文件

@interface Button : NSObject {

@private
    NSString*               gID;                                 
    NSString*               gBackColor;                          
    NSString*               gIconImage;                          
    int                     gIndex;                              
    BOOL                    gEnable;                            
    BOOL                    gVisible;
    NSString*               gText;

    NSMutableDictionary*    gEvents;


    BOOL                    gUseCircle;                 
}

@property (nonatomic,copy) NSString                 *ID;
@property (nonatomic,copy) NSString                 *BackColor;
@property (nonatomic,copy) NSString                 *IconImage;
@property int Index;
@property BOOL Enable;
@property BOOL Visible;
@property (nonatomic,copy) NSString                 *Text;
@property (nonatomic,getter=getEvents,retain) NSMutableDictionary       *Events;
@property BOOL UseCircle;

@end
Run Code Online (Sandbox Code Playgroud)



.m文件

@implementation Button
@synthesize ID = gID;
@synthesize BackColor = gBackColor; …
Run Code Online (Sandbox Code Playgroud)

copy properties objective-c retain nsmutabledictionary

3
推荐指数
1
解决办法
2463
查看次数