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

    Aug 20, 2011
    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.



    In text:

    - (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

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

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

    Jan 13, 2011
    Los Angeles, CA
    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

    Aug 20, 2011
    Thank you so much. Both solutions worked great. =]

Share This Page