automatic-ref-counting

unknown option character `f' in: -fno-objc-arc

↘锁芯ラ 提交于 2019-12-23 15:29:49
问题 I'm on xcode 4.3.2 and I'm compiling zmqobj https://github.com/jeremy-w/objc-zmq.git. The original targets included in the project are for os x, but I'm trying to add a new target for ios. For the new target it's giving me ARC complaints (because the code is non-ARC). However when compiling for the original os x target it doesn't give me these warnings. Adding the -fno-objc-arc gives me: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown

UIViewController's didReceiveMemoryWarning in ARC environment

情到浓时终转凉″ 提交于 2019-12-23 07:03:47
问题 I'm evaluating the switch to ARC (automatic reference counting) and the refactoring to apply to my code. Among the things I have to figure out, there is this: what should I do in didReceiveMemoryWarning if the explicit release of objects is not allowed by ARC? Currently, I use that method to release objects belonging to my controller and that are easily retrievable via lazy getters: - (void)didReceiveMemoryWarning { [_foo release]; _foo = nil; [super didReceiveMemoryWarning]; } and the

Does Automatic Reference Counting work as garbage collector? [closed]

回眸只為那壹抹淺笑 提交于 2019-12-23 06:23:25
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . With last version of iOS Apple has implemented Automatic Reference Counting for Objective-C, but I don't understand as works. 回答1: Automatic reference counting inserts retain and release messages into your code

Measure strong/weak ARC references impact - Impact on execution time [closed]

邮差的信 提交于 2019-12-23 05:16:41
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I was wondering if (and how much) strong/weak references management have an impact on code execution, especially when freeing objects to which many classes might have a weak reference. At first I mistaken this for ARC, but it's not. There's a similar question on the same topic,

Delegate method won't fire (is null). Using ARC

放肆的年华 提交于 2019-12-23 04:27:04
问题 I'm having trouble getting my delegate method to fire. I have the following code: @class Location; @protocol LocationDelegate - (void)location:(Location*)location foundLocation:(CLLocation*)location; - (void)location:(Location*)location failedToLocateUserWithError:(NSError*)error; @end @interface Location : NSObject { __unsafe_unretained id <LocationDelegate> delegate; } @property (nonatomic, assign) id <LocationDelegate> delegate; @end ... @implementation Location @synthesize delegate; -

Loading properties from JSON, getting “message sent to deallocated instance”

心不动则不痛 提交于 2019-12-23 04:04:27
问题 So I load my custom object from a web service and am trying to store the properties as NSStrings but keep running into this error: -[CFString _cfTypeID]: message sent to deallocated instance 0x100d3d40 -[CFString retain]: message sent to deallocated instance 0x100d3d40 I enabled zombies, but that's not really showing me a solution. My properties are defined as: @property (strong, nonatomic) NSString *title; @property (assign, nonatomic) NSString *ID; @property (strong, nonatomic) NSString

Object deallocated in ARC mode

醉酒当歌 提交于 2019-12-23 02:25:26
问题 The object is deallocated in ARC mode and causes crash. My code below; BlockAlertView* alert = [BlockAlertView alertWithTitle:title message:message]; [alert setCancelButtonWithTitle:NSLocalizedString(@"No", @"No Button") block:nil]; [alert addButtonWithTitle:NSLocalizedString(@"Yes", @"Yes Button") block:^{ //Do Something }]; [alert show]; It appears the correct alert view(which is custom UIView) but when I click one of the button it crashes. The crash log; 2015-04-07 22:28:17.065 Test[3213

How to keep a strong reference inside of a block without having a retain cycle

一世执手 提交于 2019-12-23 02:19:06
问题 I have a block attached to a button (using this category): __unsafe_unretained typeof(UIImage) *weakPic = originalPic; [button addEventHandler:^{ switch (state) { case state1: { UIViewController *vc = //some VC vc.pic = weakPic; // weakPic is nil at this point // putting originalPic here would solve my problem // but then I would have a retain cycle } case state2: { // other stuff } } }]; the action associated with the button is different depending on the state. Here is the problem: I must

Cocos2d, iOS: what is the correct way to remove sprites from cache?

*爱你&永不变心* 提交于 2019-12-22 14:57:08
问题 I got a GameScene class that is not a singleton instance. Hence I allocate and deallocate it every time the user chooses a new level and keep the "static"/"shared" data in a different singleton class (E.g. GameManager). I am using ARC . I would like to understand if my approach is correct under the memory management point of view. In other words, is it enough to call "removeUnusedSpriteFrames" at cleanup? Will this remove all sprites in game-art-forLevelOne-hd.plist? Should I do something

Ad Hoc iPhone SIGSEGV crash while Debug on device & simulator works

这一生的挚爱 提交于 2019-12-22 14:51:46
问题 App crashes immediately after I attempt to login so it can’t a be a watchdog memory issue Reason: _mh_execute_header App crashes upon attempting to make a network request using ASIHTTPRequest. Request never touches server. ASIHTTPRequest: I use -fno-objc-arc to omit ASIHTTPRequest from ARC. I believe that the following call is causing my problems since my call never even touches the server when I make a request. Any help would be greatly appreciated! Call: NSDictionary *response = [