Hi,
So I'm still very new to this whole objective C think and I ran into a problem I'm not sure the root cause for.
My h file looks basically like this :
@interface DrinkDetailViewController : UIViewController<UITextFieldDelegate>
{
UITextField* nameTextField;
UITextField* activeView;
}
@property (nonatomic,retain) IBOutlet UI...
How can I load a web page when internet is available and cache it for offline use and it updates to the latest version when internet becomes available again?
...
-(void)viewWillAppear:(BOOL)animated{
//something here
[super viewWillAppear];
}
my question is is this line [super viewWillAppear]; always required? if not when and why do you use it?
...
I need a UIDatePicker for selecting Month and Year only. I checked the class reference documents. Looks like UIDatePicker is a UIView. I imagined UIPickerView may be a sub view and I can hide the component if I can grab it. But no. That was not possible. Do I have to create my own custom picker then? Any ideas?
...
Hi,
This is the code for toggleAddProject method, the Core Data code is almost the same as found in Apple's CoreDataBooks sample, however when I click the add button the app crashes with entityForName: could not locate an NSManagedObjectModel for entity name 'Project' on the line starting with newProjectController.project
-(IBAction)t...
I am following Apple's ScrollSuite example, however pinch to zoom is not working. I am not sure whats wrong:
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
// set up main scroll view
imageScrollView = [[UIScrollView alloc] initWithFram...
I have a currently working program that has IBOutlet and IBAction connections from the interface to File's Owner. I made a new class, and added that to the document window in Interface Builder. Then I moved everything from the File Owner class files to the new class files. I removed the old connections and reconnected everything to the n...
I have a UIScrollView and a UIImageView which I have created programatically without interface builder. How can I make sure both auto-rotate in horizontal orientation?
...
How to validate a phone number (NSString *) in objective-c? Rules:
minimum 7 digits
maximum 10 digits
the first digit must be 2, 3, 5, 6, 8 or 9
Thanks
...
How would I have a button that would add a Section to a UITableView? I know how to do it without adding sections and just having a list but how would you allow the user to add section as well as cells/rows.
...
we are trying this for password settings,so that cursor should not be visible to user.
...
Hi. After much reading and many tutorials I'm now attempting to write my first iPhone app, but already starting to run into complications so want to go back to basics and ask whether I've got the fundamental UI design correct:
MainWindow.xib has a TabBarController. The TabBarController contains 3 NavigationControllers, each containing ...
In one of my methods i have this code:
-(void)myMethod {
UIBezierPath *circle = [UIBezierPath
bezierPathWithOvalInRect:CGRectMake(75, 100, 200, 200)];
}
How do i get it to show on the view?
I tried addSubview but it gave me an incompatible type error because its expecting a UIView.
I'm sure this must ...
I have a chalk board image and I want it to be like it your writing on the chalk board so the textbox would have to invisible but still functioning....
Any idea how I could do that?
...
Hi everybody,
I'm currently trying to create a navigation based application, pushing views to change the screen content. I'm trying to set up a button which can allow me to "restart" from the first screen, but I can't figure out a way to do that.
If I "push" the first view, there will be a "back" button, and I'll just have another piec...
Hi all,
Im sure this is going to be one of those things where someone points out something really obvious that Im doing but I cant for the life of me find the problem. Basically I have an array of strings and I am loading the text from the array into my uitableviewcells as and when it is needed. The problem comes when I begin to scroll ...
I have the following:
NSDateFormatter* df = [[NSDateFormatter alloc]init];
[df setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"];
NSDate* date = [df dateFromString:[sDate stringByReplacingOccurrencesOfString:@"Z" withString:@"-0000"]];
[df release];
I would like the output string to be "9/20/10"
How can I do this?
...
I would like to add the text "Sent from " to the bottom of the message
if([MFMailComposeViewController canSendMail]){
MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
controller.mailComposeDelegate = self;
[controller setSubject:[NSString stringWithFormat:@"A message from: %@",se...
I'd like a UIView to slide up from the bottom of the screen (and stay mid-screen) like a UIActionSheet. How can I accomplish this?
UPDATE:
I am using the following code:
TestView* test = [[TestView alloc] initWithNibName:@"TestView" bundle:nil];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.4];
[UIView setAni...
I am trying to get a random color. I have done it using brute force but this method seems overly laborious (though the distribution is pretty even):
- (UIColor *) getRandomColor {
// GOAL: reject colors that are too dark
float total = 3;
float one = arc4random() % 256 / 256.0;
total -= one;
float two = arc4random() % 256 / 256.0;
...