correct example:
- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}
wrong example:
- (void)dealloc {
[super dealloc];
[viewController release];
[window release];
}
Althoug in alsmost all other cases when overriding a method I would first call the super's method implementation, i...
I've choosen the "view-based" application template in Xcode. The myProjectViewController.m has the following code:
/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/
That sounds good. But: The template generated a myProjectViewController.xib file. What I dont get is: How ...
I have a program which automatically launches a phone call when program is started. This is implemented in AppDelegate's "applicationDidFinishLaunching"-method.
Problem is: When phone call ends and my app automatically launches again, it restarts that loop and phone call is started again.
How to recognize if app was returned from that ...
Hi
I am trying to convert a string to date in a separate time zone from the current system time zone. I have set the time zone of the dateformatter to this timezone. But the NSDate I get is always in my current time zone.
For instance, my current time zone is PDT. I have set the DateFormatter's time zone to CST. I have a string with th...
For some reason, the representation in Xcode "Groups & Files" does not match the file hierarchy in the folder where all my real project files are. And for some reason, I can't copy a entire group or even single file and put that into another project. So I have a nice hierarchy of images within "Groups & Files", but all thos ordered image...
I've written an Objective-C class and I'm using a shared instance of it across several of the views in my iPhone project. Its member variables include bools, ints, NSStrings and one NSNumber. The shared instance seems to work just fine across the scope of my application, except for the NSNumber which the debugger tells me is "out of scop...
I have created a blank new view-based application project in Xcode. It generated a myProjectViewController and an nib for it. In that nib for that view controller, there is just one view. I wanted to test some event handling stuff and created an -(IBAction) method that will just log a "hello world" when I touch the view. But for some rea...
Interface Builder will only allow me to hook up such events for an button. But like in HTML, I just want to haven an blank UIImageView where - as soon as the user taps it - a method is invoked. I hope there is some cool programmatically way of doing that, which I don't know about.
UPDATE:
In my View Controller that creates the UIImage...
I haven't tried that yet, but I assume that I would have to disable scrolling of the parent scroll view as soon as I know that the user will want to scroll in the child scroll view, right?
Both scroll views are scrolling horizontal.
How could I disable scrolling detection of the parent temporarily? Or is there some other way?
...
Hi All,
I have created an audio streaming application for iphone.- I have used the code from this link idevkit.com/forums/general-sdk/225-streaming-audio-class.html
They are using a logic to find the end of file by keep tracking the number of buffers enqueued and emptied. when these two values become equal it assumes that we are at the...
In short: I want to have two fullscreen views, where I can switch between view A and view B. I know I could just use an Tab Bar Controller, but I dont want to. I want to see how this is done by hand, for learning what's going on under the hood.
I have an UIViewController that acts as an root controller:
@interface MyRootController : UI...
I'd like to create a pop-up menu similar to the one found in the mail app when you want to reply to a message. I've seen this in more than one application so I wasn't sure if there was something built into the framework for it or some example code out there.
...
Is there a way to control the position of the auto correct view that pops up while typing in a UITextField?
By default it appears to always appear below the text field. However in Apple's apps like SMS it sometimes appears above the text field.
For text fields aligned right above the keyboard the auto correct is blocked by the keyboar...
I have a large number of UIViews that are created in the app delegate applicationDidFinishLaunching and added to an NSMutableArray. The user pages through these views using a page control and scroll view. I created the UIView and its child components in IB. They are wired to a controller. To create 170 views on the iPhone takes about...
How do you declare, set properties, synthesize, and implement an int array of size 5 in Objective C? I'm writing this code for an iphone app. Thanks.
...
I need to make a round object much like a speedometer (with moving needle inside indicating a value) in a browser. currently for all other items on this page iam using jquery. I rather not use flash as it needs to be ipod / iphone usable.
Any experience others have had doing this is greatly appreciated.
...
Example:
I have 10 view controllers, which are all allocated and initialized in the same way:
UIViewController *controller = [[MyViewController alloc] initWithNib];
(note that -initWithNib is a custom method of a UIViewController subclass)
The next view controller class is OtherViewController, and so on. I want to load the view cont...
I have a class XMLParser. It works fine as long as I don't remove the commenting of the line that adds the nodes to the NSMutableArray:
[nodes addObject:self.currentNode];
If I do that, the application crashes - without leaving any trace in the debug log.
How can this be?
XMLParser.m:
#import "XMLParser.h"
#import "MyViewController....
When I rotate my iPhone into landscape mode, the iPhone automatically bumps the text size up.
What is the best way to prevent this? I'd like rotation to give the visitor more text to read, not a larger font. Is JavaScript like this the only way to go?
...
I would like to my object to receive notification with the DeviceToken becomes available. Is there a way to delegate only certain functions from the UIApplication to my class?
Update:
I'm not so much interested in accessing it from the application delegate, I already have an application delegate, but want to respond to the event via c...