uikit

Core data / NSFetchedResultsController error

I'm having some trouble with core data / NSFetchedResultsController. I'm not entirely sure where the error is as the message is quite vague. I have an issue with inserting more than one object when the fetched results controller has no objects fetched. The following code will crash with the following error if I try and insert several o...

Align UIView to bottom of parent's frame / view

How can I align my UIView so that it aligns to the bottom of parents frame? Normally I would create it and move to the bottom of the view, in a full screen view that is 460px tall: myView = [[MYView alloc] initWithFrame::CGRectMake(0.0f, 300.0f, 320.0f, 160.0f)]; But how can I set this up so that if the available space for my iPhone ...

cocoa iphone load modal view without seeing it

Hey there, Is there a way to load a view modally without seeing it? I need to access methods on the modal view controller which in turn set properties of UI components in a XIB. I want to set those properties, but I don't want to see the view right away. I want to reveal it when the user rotates the phone. Everything is working, exc...

Can I add two right-hand buttons to a UINavigationBar?

I would like to be able to have a UINavigationBar with a left-hand UIBarButtonItem, two right-hand UIBarButtonItems, and a title. I have resorted to using a UIToolBar to simulate this, but the toolbar looks slightly different than the UINavigationBar, and it also won't bevel UIBarButtonSystemItems. Is there a way to make a UINavigation...

how to get touchesMoved events more frequently?

I'm tring to track a user touch moving across the screen, but at times my app receives touchesMoved:withEvent: with locations far apart, even by 70 pixels. I'm keeping the runloop fairly fluid, but I have CoreAnimation somewhat under pressure. I'm puzzled because I'm noticing the same problem even on the simulator. ...

Getting data from one table back to a previous one in an iPhone table based navigation app

Hi all, I'm confused about how to implement a specific piece of an app. The data is being collected in a Grouped Table, but certain rows drill down to another screen to allow the user to choose something. So for example, I would have Name: Surname: Age: How do I get this Age value back to the first view when the user taps done ? ...

Laying out & sizing of subviews in a UIViewController

I have an app with with a UITabController and each tab is a UINavigationController. The root of one of my UINavigationControllers is a UIViewController. Inside that view controller's view, I want to layout some subviews, but I'm confused as to where & how to lay them out in a way that will be resolution independent (i.e. not hardcode va...

Most effective "architecture" for layered 2D app using OpenGL on iPhone?

Hi all. I'm working on an iPhone OS app whose primary view is a 2-D OpenGL view (this is a subclass of Apple's EAGLView class, basically setting up an ortho-projected 2D environment) that the user interacts with directly. Sometimes (not at all times) I'd like to render some controls on top of this baseline GL view-- think like a Heads-U...

Resize font size to fill UITextView?

How would I set the font size of text in a UITextView such that it fills the entire UITextView? I'd like the user to type in their text, then have the text fill the entire UITextView. Any help is appreciated! ...

Make my view as pretty as NSAlertView

Hi all, I have a modal view in my iPhone app (Xcode, Objective C++). How do I make it look as pretty as the system UIAlertView? Specifically, I want: rounded-rect window with a border around it semitransparent background subtle highlight near the top The transparency can be probably achieved with a less than one alpha channel on the...

Best way to handle multiple UITableViews in one UIViewController?

I have a UIViewController that should be capable of displaying tableViews with multiple data sources. The UITableView spans about half the size of the screen, and there is and up and down button that allows you to go through different data. Everytime the up and down button is hit, I'd like to ultimately use UIViewAnimationTransitionCurlD...

UISlider and REAL Time

I'm trying to use a UISlider to act as a Time limit. Problem is that the values go to .99 before flipping to 1. My code so far is int _min = (int)mySlider.value; NSLog(@"Slider Int Minutes %i",_min); NSString *str = [NSString stringWithFormat:@"%.02f",mySlider.value]; int stringLength = [str length]; NSRange range = NSMakeRange(0, s...

How to intantiate a UITableViewCell from a nib

One can add a tableviewcell in the nib of its tableviewcontroller, but how do you get to it ? ...

Need help understanding how IB-created UIViews are added programmatically

I am in a situation where one of my ViewControllers has many special cases and I need an elegant way of handling them. The general idea is that the bottom half of my View is identical in each case. The top half changes for each case. In accordance to DRY, I want to avoid make copies of my ViewController for each special case and changi...

How to get Apples buggy "Locations" example to work?

Unfortunately, Apple did not test it's tutorial at all. The "Locations" demo is really buggy and the edit Button does not even exist. I have no typo. First I didn't do copy & paste, and after that, I also attempted to just copy&paste their stuff. A lot of relevant code is completely missing. They simply do this in view did load, without...

How to handle UISwitchView in edit functionality?

I am storing values of ON/OFF of switch view in the object. For the second time when we go to that view controller the switch view is always in the off state. But the value in the object is 1(ON).For the second time when we go to next controller, It should be ON state. ...

How to handle UICustomSwitch in edit functionality?

@interface UICustomSwitch : UISwitch { } -(void)setLeftLabelText:(NSString *)labelText; -(void)setRightLabelText:(NSString *)labelText; @end @implementation UICustomSwitch -(UIView *)slider { return [[self subviews ] lastObject]; } -(UIView *)textHolder { return [[[self slider] subviews]objectAtIndex:2]; } -(UILabel *)leftLabel...

iPhone app views logic

I have an iPhone app in development that requires three slides (views). The problem is, since I'm kinda new to this, I'm not sure what's the most logical way to approach this situation. I was going to use a UINavigationController, but then I noticed that the UINavigationController is meant for hierarchical content, which means that it s...

Can font size of UILabel be changed with smooth animation on iPhone?

I want a UILabel to swell slightly when selected like in some game menu screens. To get smooth resizing I presume I should put some change to the label's properties in an animation block. The obvious thing to try is to change the label.font.pointSize property but that's readonly. Scaling the label's .transform property with CGAffineTra...

Smooth scaling when adding/removing subviews to/from a UIView

I'm using a subclass of a UIView to (programmatically) contain and manage numerous subviews (mostly UIImageViews) that are to be positioned adjacent to each other such that none are overlapping. It's safe to assume that the subviews are all the same height (when originally drawn), but are varying widths. The container might be resized,...