有人可以告诉我我做错了什么,应用程序(iphone ios5)在执行“addStatus:statusObj”时会崩溃吗?
id<Statuses> statusObjects;
statusObjects = [Status singleton];
id<Statuses> statusMessagesObjects;
statusMessagesObjects = [[Status singleton] copy];
StatusObj *statusObj = [[StatusObj alloc] init];
statusObj.date = [NSDate date];
[statusMessagesObjects addStatus:statusObj];
StatusObj *tmpObj = [statusMessagesObjects getStatusAtIndex:0];
DebugLog(@"-- debug -- %@", tmpObj.date);
---------------------------------------头文件---------- -------------------------
@interface Status : NSObject <Statuses, NSCopying>
{
NSMutableArray* status;
NSString* path;
}
+ (id) singleton;
@property (copy) NSString* path;
- (void) addStatus:(StatusObj*)statusObj;
- (void) deleteStatusAtIndex:(NSUInteger)index;
- (StatusObj*) getStatusAtIndex:(NSUInteger)index;
- (int) count;
- (void)save;
- (id)copyWithZone:(NSZone *)zone;
@end
@protocol Statuses <NSObject>
@required
- (void) addStatus:(StatusObj*)statusObj;
- (void)deleteStatus:(StatusObj *)statusObj;
- (void) deleteStatusAtIndex:(NSUInteger)index;
- (void)deleteAllStatuses;
- (StatusObj*) getStatusAtIndex:(NSUInteger)index;
- (int) count;
- (void)save;
@optional
- (void)moveStatus:(StatusObj *)statusObj toIndex:(NSUInteger)newIndex;
@end