Hey guys,
Does anyone know what made Apple leave out NSAttributedString when turning AppKit into UIKit?
The reason I ask is that I would really like to use it in my iPhone app, and there appears to be no replacement or alternative than doing it myself...
It is possible to have mixed font attributes on a string - it's just a hell of a ...
Apple lists (http://developer.apple.com/samplecode/AudioQueueTest/listing1.html) as a quick demonstration of playing an audio file.
Is there a way to play an audio file with many less lines of code?
...
I want to disable buttons in the UIAction sheet and enable them after a certain condition is true. How do I achieve this? Any ideas?
...
Hey all,
I'm trying to post an image to TwitPic.com using their API.
However, I have never posted an image using HTTPPOST or however else before.
Anybody enlighten me to how I can post NSData from a UIImage using their api?
...
Hello,
I have UITextView view in my Iphone application which displays large text and I am paging that text with offset margin, but the problem is, that it has some kind of margin or padding and it messes up my calculations (it seems to be diffferent depending on font style).
Is it possible to get rid of that unnessecary space around UI...
Hey guys,
I have a UIWebView in my app which I want to use to display an image which will link to another url.
I'm using
<img src="image.jpg" /> to load the image.
The problem is that the image doesn't load (ie. it can't be found) even though it's added as a resource in my project and is copied into the bundle.
I've tried using NSB...
I'm creating a simple color picker controlled by a custom slider type control.
I'm passing a float value from my slider to a UIColor constructor method and updating the background color of a CALayer as the value changes.
It runs really smooth in the simulator, but I get a lot of flickering when running on the device.
Is this just bec...
I'm trying to mimic the default emboss that automatically gets applied to navigationItem.title, as well as many other UIKit controls.
As seen in this screenshot's title ("Table Cells"):
I'm essentially trying to add 2 UILabels to the navigationItem.titleView, however the UILabels just show up as flatly drawn and it really just doesn'...
To customize the visual look of a UISlider you can set the thumb and track images. Part of the track images gets stretched to the appropriate with. From the documentation:
A stretchable region sits between two
end cap regions. The end caps define
the portions of the image that remain
as is and are not stretched. The
stretchab...
Let me try to explain it. Please tell me if I am wrong. I am just 70% sure about it.
Like I understand it, an UIView has a frame and an bounds rectangle.
The job of the frame rectangle is to set the position of the UIView relative to it's superview. More precisely: Relative to the coordinate system of the superview. The job of the bound...
Apple says, that all I have to do is to modify the bounds rectangle. Then the content inside the bounds rectangle would be stretched or jard into the frame rectangle.
But when I assign another CGRect with a smaller width to my bounds rectangle, nothing happens. The UIImageView keeps looking exactly the same. No compile errors. I guess t...
Apple says, that I need to have Outlets in my File's Owner for all my top level objects in a Nib file.
As much as I know, these objects are NOT the File's Owner itself (would make no sense, right?) and the First Responder.
I am unsure about: The View object in the Nib, and any controller object in the nib. Do I need an outlet for thos...
Somewhere I was reading that I would run into memory problems when I give up a view temporary due to an low memory warning (loading it again as soon as the user wants to see it), if theViewController class does not do things like this on every outlet of that view:
-(void)dealloc {
[myView release], myView = nil;
[myLabel release...
Currently I am jumping into the ice cold water called "memory management in iPhone OS".
Here's one rule i've learned:
Every time I see an alloc in my method, I will release that corresponding variable at the bottom of the method.
Every time I create an @property(...) in my header file which says copy or retain, I put a release message...
Here's an sample code, where only the "string" object is released.
NSString *nameOfFile = ... ;
NSError *error;
NSString *string = [[NSString alloc] initWithContentsOfFile:nameOfFile encoding:NSUTF8StringEncoding error:&error];
if (string == nil) {
// handle error
}
[string release];
I understand why the error object is not releas...
I feel that both are the same thing, but I am not sure.
...
Apple says, that in Cocoa -dealloc will not be called neccessarily when the application quits. Does this also apply to the iPhone?
...
I've been reading that if an collection "gets released" it releases all it's objects as well. On the other hand, I was also reading that a collection would release it's objects as soon as the collection gets deallocated.
But the last thing may not always happen, as apple says. The system decides if it's good to deallocate or not. In mos...
I am wondering how many there are, and where they are. As I have seen in a Stanford Vid, there is one autorelease pool installed in the event loop of an iPhone App. But I think I missed the point where exactly that is? And are there any other autorelease pools that I should know about?
...
#import <UIKit/UIKit.h>
int main(int argc, char *argv[]) {
NSLog(@"new event...");
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
If that's the case, then the main() function would have to be called on every event, ...