how would i go about loading a new xib when the orientation of the device is changed? i.e. load a landscape oriented xib when the device is turned into landscape orientation and vice-versa with portrait. and how would i go about automatically detecting an orientation change and adjusting from there?
...
There seem to be lots of answers for cross-platform frameworks for devices (iPhone + Android), and cross-platform frameworks for desktops (Mac + Win + Linux). This is a different question regarding a suitable framework, methodology, template app, tutorial, or just helpful hints, on developing native apps (not just web apps) that are cro...
I have a small bug in my client app that uses NSURLConnection. I have tracked it down to an unexpected connection keep-alive that seems to confuse the web server (probably a bug on the server side). The workaround would be to force-close all outstanding connections at a certain point. Can I do this somehow with NSURLConnection, i.e. some...
There're an UINavigationController with rootViewController (as root) and secondViewController (as a child). The rootViewController should be able to rotate to any orientation (that works as expected, I just override the shouldAutorotateToInterfaceOrientation), but the secondViewController should work in Portrait mode only (here, I set th...
I need to connect to a remote host and exchange data with some binary protocol. I'm connecting with:
CFStreamCreatePairWithSocketToHost(NULL, (CFStringRef)@"whatever.host.com",
port, &readStream, &writeStream);
Everything is fine, except the error handling. I'm
handling NSStreamEventErrorOccurred in my stream's delegate...
i am trying to create a stack of UIImageViews in my app where i can indefinitely touch the uiimageview move it around the screen and drop it anywhere and there would still be a representation of the UIImageview in the original location where i could go grab another uiimageview move it and so on.the way i was trying to solve this problem ...
I tried the following code, but it doesn't work. How should it be modified?
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
location = [touches locationInView:self];
}
In the h files I have defined location like this:
CGPoint location;
...
can anyone tell me why this line would throw an incompatible types error?
UIDeviceOrientation *orientation = [UIDevice currentDevice].orientation;
...
I have a UISlider inside a custom UITableViewCell named SliderCell.
I have a method in SliderCell which updates a UILabel to match the slider's value.
- (IBAction)sliderChanged:(id)sender;
I have the same method in a viewController that uses SliderCell in it's table. Base on the value of the slider, I want to reload an NSDictionary.
...
i want to dynamically create and add to the view a uiimageview when a touch is registered within the frame of another uiimageview. i want these to stay on the screen and remain moveable when a touch is registered inside the frame of each uiimageview. here is the code i have now but it doesn't quite work right and is really glitchy(i.e. i...
This seems to work, but then the program crashes right after the button get highlighted.
-(IBAction) buttonPressed: (id) sender
{
[sender setHighlighted:YES];
}
How should this be diffeent? What would it look like if I wanted to highlight the button if it was not previously highlighted, and return the button to its normal stat...
When the UITextField is selected a keyboard popups up. Can this behavior be modified so that instead it loads a different view?
...
In a tab bar application I made a view controller for the second view. I put in an IBOutlet that is attached to a button. When the button is pressed, I want to return to the main view. This is what I put, but it crashes.
-(IBAction) cancel
{
[self.view removeFromSuperview];
}
How should this be changed?
...
Hi!
i've implemented a transition methood in my app delegate file and from every where in the
code i want to call it in order to make nice and cool transitions. i call her like that
[[[UIApplication sharedApplication] delegate] transFromMainToGalery];
for example.
the problem is that im getting warning which is ok (cause it alrea...
How do I get the current working directory's absolute path on the iPhone using Objective-C?
...
In my ~/Library/Caches/ directory, I have a symbolic link to my app's bundle, and some symbolic links to images (e.g. "big_picture.png" is a symlink to "small_picture.png"). When I try to check if the symlinks exist, using the NSFileManager's fileExistsAtPath: method, it returns NO, even when the symlink does exist, and it links to a fil...
I am trying to move my view when the user selects a text field so that the text field is still visible, which I have achieved. I am also using a control event to ensure that the text field is not empty before enabling a button.
Using
[longTextField addTarget:self action:@selector(updateAnswerButtonEnabled:) forControlEvents:UIControlEv...
Im trying to implement an undo manager in my app using Core Data. Instead of making my own UndoManager im using the default undo manager in my ManagedObjectContext. Because of that i am not registering any actions manually, neither am i beginning or ending any undo groups. Undo works fine for most conditions however at certain conditions...
I am writing an app that connects to a database to fetch data. Since the fetching is expensive and the data is generally unchanging, I'm using CoreData to cache the results so that I can do fast, local queries.
From the database, for each type, there is a string property that is guaranteed to be unique. In fact, there is a URI scheme fo...
I have a series of UIView subclasses that are added as subviews. Each subview can be dragged and dropped. When they are dropped (touchesEnded), I need to run a method in the viewController to do some work. I currently have the touchEvents handled in each subview class. Should I be handling these touch events in the viewController or shou...