Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Error Message In Xcode

hi i have recintly got Xcode for my computor and i am learning how to use the code. I am lerning form "tuturial for Xcode app" and copyed the code over for the first app i made there is a error message and i can not fix it. Here is the code and error



//

// ViewController.m

// First Program alart iphone

//

// Created by Jennifer Sheridan on 18/08/13.

// Copyright (c) 2013 Oscar Winter. All rights reserved.

//


#import "ViewController.h"


@interfaceViewController ()


@end


@implementation ViewController


-(IBAction)sayhello:(id)sender{

UIAlert View *alert = [ULAlert alloc]

initwithtitle:@"hello message"

message:@"hello There everyonr"

delegate:self

cancelbuttontitle:@"ok"

otherbuttontitles:nil];

}



- (void)viewDidLoad

{

[superviewDidLoad];


// Do any additional setup after loading the view, typically from a nib.

}


- (void)didReceiveMemoryWarning

{

[superdidReceiveMemoryWarning];

// Dispose of any resources that can be recreated.

}


@end




if you have any idear please post a responcie


thanks


osky4

Applications-OTHER, OS X Mountain Lion (10.8.4)

Posted on Aug 18, 2013 2:14 AM

Reply
8 replies

Aug 18, 2013 12:31 PM in response to osky4

UIAlert View *alert = [ULAlert alloc]

initwithtitle:@"hello message"

message:@"hello There everyonr"

delegate:self

cancelbuttontitle:@"ok"

otherbuttontitles:nil];


1. Read this code carefully. You have misspelled UIAlert as ULAlert prior to the alloc.

2. You have mismatched brackets, you need a 2nd opening bracket prior to UIAlert alloc.

Aug 18, 2013 5:27 PM in response to osky4

The class names, method names, and parameter names must all be spelled correctly, including proper case. You must either use code completion to make sure they are valid, or carefully read the class reference documentation on the specific class/method/parameters. This information is usually one click away in Xcode Quick Help inspector. For example, the UIAlertView class reference clearly describes the parameters.


http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIAlertView _Class/UIAlertView/UIAlertView.html


initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:

Convenience method for initializing an alert view.

- (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ...

Error Message In Xcode

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.