automatic-ref-counting

iOS AdMob memory leak?

谁说胖子不能爱 提交于 2019-12-12 07:37:22
问题 I just started using AdMob but I noticed that, after running it for about an hour, it's accumulated 50MB! Yikes. I thought about releasing it but I can't since I am using ARC . Any ideas? I'm using the getting started code provided by google: GADBannerView *bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner]; CGRect newFrame = CGRectMake(self.scroller.frame.origin.x,self.scroller.frame.origin.y + 70,self.scroller.frame.size.width,self.scroller.frame.size.height); [self

When should I use the weak or strong qualifier with IBOutlets? [duplicate]

会有一股神秘感。 提交于 2019-12-12 07:29:07
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Should IBOutlets be strong or weak under ARC? In the documentation, I read "Outlets should generally be weak, except for those from File’s Owner to top-level objects in a nib file (or, in iOS, a storyboard scene) which should be strong." Examples? I don't understand when it's better use "weak" instead of "strong" property for an IBOutlet. 回答1: In general: if you are making an outlet to a subview of the

Setting uiimage to nil doesn't release memory with ARC

99封情书 提交于 2019-12-12 07:19:28
问题 I have a scrollview that shows different images as it's scrolled through the pages, like PhotoScroller. I'm using ARC. When someone scrolls to another page, I set the image property of the UIImageView not being currently show to nil, as (attempting) to avoid memory crashes, which are still happening. Then when the user scrolls to a new page, the image for that page is set as the UIImageView's image property, as well as the page before and after it (for smooth viewing). The UIImage's for the

Delphi ARC under Firemonkey for Windows

﹥>﹥吖頭↗ 提交于 2019-12-12 06:23:52
问题 I am watching this video where Marco is talking about Automatic Reference Counting. I already knew that under Android and iOS (Firemonkey) my objects are ref counted so I don't need the try finally block. Does the reference count implementation work according with the platform (VLC or FMX) or with the OS? What I mean is: var a: TObject; begin a := TObject.Create; a.use1; a.use2; end; This is good in Firemonkey if it runs on Android/iOS/Mac, I have no memory leak. But if I ran this under

Does a passing of an object to a block guarantee that its lifecycle will be retained?

陌路散爱 提交于 2019-12-12 04:59:13
问题 Let's assume I have the following typedef: typedef void (^myBlock)(id); And I have some method myMethod accepting myBlock as an argument and yielding some id variable to it: void myMethod(id myObj, myBlock block) { // ... block(myObj); // ... } So if I have the following: - (void) someMethod { __block id myObj; // Some initialization local to the scope of someMethod; // myObj = ... some assignment to myObj so it is not nil... dispatch_async(someQueue(), ^{ // (*) Some long, possibly multi

Are Unowned references set to 'nil' when deinitialized?

耗尽温柔 提交于 2019-12-12 04:36:34
问题 I'm confused on this topic in swift where it is said that unowned references must always have a value and cannot be optional, also meaning they cannot be set to 'nil'....well I just saw a program on the Apple documents for swift that instance 'A' with an unowned reference to instance 'B' was deinitialized and deallocated right after instance 'B' was deinitialized/deallocated......when a var is deinitialzed/dealloc doesn't it mean they are set to 'nil'??? Instance B is an optional so sure it

Arrk! ARC error:'CFTypeRef' (aka 'const void *') to 'NSNumber *' is disallowed

試著忘記壹切 提交于 2019-12-12 03:47:46
问题 I'm trying to convert some Apple code (from SquareCam example) to ARC. I had the Apple code flagged to compile as non-ARC and it worked but I was getting crash errors passing images between the non-ARC context to an ARC context - so I'm trying to resolve that. Anyway, I think I have got all the ARC stuff handled except for this line: NSNumber *orientation = CMGetAttachment(imageDataSampleBuffer, kCGImagePropertyOrientation, NULL); This is used for the CIDetectorImageOrientation key value

Does assigning a weak pointer to a strong pointer copy the object?

自作多情 提交于 2019-12-12 03:45:20
问题 The common pattern to avoid capturing self within a Block is to create a weak self outside the Block and use this to create a "locally strong" version of self within the Block (inner self). __weak ClassX *weakSelf = self; [someOtherObject methodThatTakesCOmpletionBlock: ^{ ClassX innserSelf = weakSelf; //innserSelf creation? [someObject send:innerSelf.prop;}]; What happens when the innserSelf creation line is executed? Is innerSelf a copy of self at the time the method

Crashing on unrecognized selector sent with SimplePost request after it works successfully.

两盒软妹~` 提交于 2019-12-12 03:35:35
问题 I've been using the SimplePost classes for several weeks and haven't had any problems. Now I'm crashing after a Request returns proper data in a Connection. I haven't (knowingly) touched the SimplePost class files. But when I run the analyzer, it now (never did before) points out the following method: + (NSMutableURLRequest *) urlencodedRequestWithURL:(NSURL *)url andDataDictionary:(NSDictionary *) dictionary { // Create POST request NSMutableURLRequest *urlencodedPostRequest =

Javascript file not linking to html

微笑、不失礼 提交于 2019-12-12 03:35:15
问题 Hello I finished all of my code but my Javascripts aren't showing to my html but I am sure that I have linked them correctly. Can I have a extra set of eyes to see what I am doing wrong? If you can that would be great because I am not very good at javascript, thanks. *I have two Java script files in here because I have one for my main javascript and ball* //ball.js function ball() { //The ball itself this.startAngle=0; this.endAngle=360*Math.PI * 2; this.radius=40; this.drawBall = true; /