Resolved 4 Errors, 1 Warning

Discussion in 'iOS Programming' started by Toastinator, Aug 20, 2011.

  1. Toastinator, Aug 20, 2011
    Last edited by a moderator: Aug 20, 2011

    Toastinator macrumors newbie

    Joined:
    Aug 20, 2011
    #1
    I just started coding today, so I guess you could call me a noob. I was following a tutorial and came across multiple errors when I attempted to compile the files. Below are screenshots of the codes and the errors/warnings with them. If you can provide any help, I thank you in advance.

    [​IMG]

    [​IMG]

    In text:

    Code:
    - (void)didReceiveMemoryWarning {
        // Releases the view if it doesn't have a superview.
        [super didReceiveMemoryWarning];
        
        // Relinquish ownership any cached data, images, etc that aren't in use.
    }
    'didReceiveMemoryWarning' undeclared (first use in this function)
    expected ';' before '{' token


    Code:
    @end
    expected declaration or statement at end of input
    '@end' missing in implementation context

    Code:
    - (void)setMainImage:(UIImage *)_img {
    	[img release];
    	img * [_img retain];
    	}
    invalid operands to binary * (have 'struct UIImage *' and 'id')
     
  2. Shawnpk macrumors 6502

    Joined:
    Jan 13, 2011
    Location:
    Los Angeles, CA
    #2
    Somewhere above the didReceiveMemoryWarning method, you may be missing a closing brace. For the other error, try this: img = [_img retain];
     
  3. Toastinator thread starter macrumors newbie

    Joined:
    Aug 20, 2011
    #3
    Thank you so much. Both solutions worked great. =]
     

Share This Page