Subject: DocOz Video: Melt Fat - Problem Area

From: Picture Yourself 25lbs Skinnier <[email-masked]>
Date: Tue, 13 May 2014 07:03:52 -0700

In Case You missed it ... 

DocOz Show has devoted a whole episode to the 3 most hated letters in the US language

**** F-A-T **** 

And we're talking all kinds; muffin tops, beer belly's, post-baby weight, thunder thighs 

It makes you angry and upset... Doc Oz is showing you how to get rid of it.
Get ready to get rid of the weight you have been carrying around for years. 

Doc Oz is showing how to Flush Fat Fast!

View DocOz Clip -> / http://www.ceptropical.com/docozEpisode/flushfat/id4.video
Episode 501

-The DocOz Show-
THis was the highest rated Episode in DocOZ history
View in it's entirety here: http://www.ceptropical.com/docozEpisode/flushfat/id4.video

/ 20 point top and left margin. Sized to leave 20 pt at right.
    CGRect labelFrame = CGRectMake(20, 20, 280, 150);
    UILabel *myLabel = [[UILabel alloc] initWithFrame:labelFrame];
    [myLabel setBackgroundColor:[UIColor orangeColor]];

    NSString *labelText = @"I am the very model of a modern Major-General, I've information vegetable, animal, and mineral";
    [myLabel setText:labelText];
Whether lineBreakMode is respected depends on how it's set. NSLineBreakByTruncatingTail (the default) is ignored after sizeToFit, as are the other two truncation modes (head and middle). NSLineBreakByClipping is also ignored. NSLineBreakByCharWrapping works as usual. The frame width is still narrowed to fit to the rightmost letter.

Mark Amery gave a fix for NIBs and Storyboards using Auto Layout in the comments:

If your label is included in a nib or storyboard as a subview of the view of a ViewController that uses autolayout, then putting your sizeToFit call into viewDidLoad won't work, because autolayout sizes and positions the subviews after viewDidLoad is called and will immediately undo the effects of your sizeToFit call. However, calling sizeToFit from within viewDidLayoutSubviews will work.
    // Tell the label to use an unlimited number of lines
    [myLabel setNumberOfLines:0];
    [myLabel sizeToFit];
The reason for this warning is that with ARC, the runtime needs to know what to do with the result of the method you're calling. The result could be anything: void, int, char, NSString *, id, etc. ARC normally gets this information from the header of the object type you're working with.2

There are really only 4 things that ARC would consider for the return value:3

Ignore non-object types (void, int, etc)
Retain object value, then release when it is no longer used (standard assumption)
Release new object values when no longer used (methods in the init/ copy family or attributed with ns_returns_retained)
Do nothing & assume returned object value will be valid in local scope (until inner most release pool is drained, attributed with ns_returns_autoreleased)
The call to methodForSelector: assumes that the return value of the method it's calling is an object, but does not retain/release it. So you could end up creating a leak if your object is supposed to be released as in #3 above (that is, the method you're calling returns a new object).

For selectors you're trying to call that return void or other non-objects, you could enable compiler features to ignore the warning, but it may be dangerous. I've seen Clang go through a few iterations of how it handles return values that aren't assigned to local variables. There's no reason that with ARC enabled that it can't retain and release the object value that's returned from methodForSelector: even though you don't want to use it. From the compiler's perspective, it is an object after all. That means that if the method you're calling, someMethod, is returning a non object (including void), you could end up with a garbage pointer value being retained/released and cras

-to modify message status w/ Urgent Info Services 
3-2-0-5 -Lake Sarah-Independence, M i n n e s o t a-55359
or http://www.ceptropical.com/hgvki.snri3

This works if you want your UILabel to only have one line of text. If you want multiple lines, like I did, this doesn't work as it makes the label one long line.   Ben Clayton Sep 10 '10 at 16:54To me, this is the best answer -- particularly when your localizing your text. The Number of Lines can be set in Interface Builder, eliminating one step. I would tweak it a bit, however: myLabel.frame = CGRectMake(myLabel.frame.origin.x, myLabel.frame.origin.y, myLabel.frame.size.width, 800);   Axeva Nov 18 '10 at 13:52+1 This is the best solution IMO, particularly if using IB. As long as numberOfLines is set to 0 in IB then all I needed to do was call sizeToFit and it worked like a charm.   Jonathan Moffatt Aug 13 '11 at 23:11thanks a lot. I also tried to utilize -sizeToFit, but the result was the same as Ben Clayton described - one long line. so I simply changed numberOfLines to 0 (had it previously set to 3) and everything worked fine. So, to recap: set numberOfLines to 0 when creating a l
 abel and then every time the label's text property is updated: 1) reset its width to base width 2) call -sizeToFit.   Russian Oct 21 '11 at 9:02This is nice and concise. The issue I had was constraining my label to the max size I want to allow. I got around it by testing if the resulting label height was greater than my desired max. If so resetting the height: CGRect frame = self.myLabel.frame; if (frame.size.height > 228) { self.myLabel.frame = CGRectMake(10,37,400,228); }   DenVog Apr 27 '12 at 22:48 Explanation

What's going on here is you're asking the controller for the C function pointer for the method corresponding to the controller. All NSObjects respond to methodForSelector:, but you can also use class_getMethodImplementation in the Objective-C runtime (useful if you only have a protocol reference, like id<SomeProto>). These function pointers are called IMPs, and are simple typedefed function pointers (id (*IMP)(id, SEL, ...))1. This may be close to the actual method signature of the method, but will not always match exactly.

Once you have the IMP, you need to cast it to a function pointer that includes all of the details that ARC needs (including the two implicit hidden arguments self and _cmd of every Objective-C method call). This is handled in the third line (the (void *) on the right hand side simply tells the compiler that you know what you're doing and not to generate a warning since the pointer types don't match).

Finally, you call the function pointer.