xcode - Objective C Pointer to pointer in method memory error -
i want return 2 objects method set method return nsdictionary , nsindexpath reference, shouldn't hard reason exc_bad_access error after method finished , returned.
- (nsmutabledictionary *)sortedmessagesunreadindexpath:(nsindexpath **)indexpathforunreadmessage { ... if (indexpathforunreadmessage != null) *indexpathforunreadmessage = [nsindexpath indexpathforrow:array.count-1 insection:dict.count-1]; ... return dict; } // call nsindexpath *unreadindexpath = null; self.messages = [self.conversation sortedmessagesunreadindexpath:&unreadindexpath]; // exc_bad_access error here after method return self.unreadindexpath = unreadindexpath;
edit
using arc, ios 7 sdk, xcode 5
Comments
Post a Comment