Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6332589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:17:37+00:00 2026-05-24T18:17:37+00:00

I am a relative novice who is teaching himself Objective-C on Xcode to develop

  • 0

I am a relative novice who is teaching himself Objective-C on Xcode to develop some simple iPhone game apps. I have done some reading on this but fear I’m missing something basic and obvious.

I made a simple “Hello, World” and, based on opinions in various forums, I decided to do a Tic Tac Toe. I found a nice video and built a version based on that, which ran fine. However, my own interpretation is already running into trouble.

I’m using Xcode 4.0.2 on Snow Leopard. I chose a View-Based Application template and pulled a large image view onto the layout to hold a PNG called board. I put nine small image views on the large one to hold individual cells for X and O (and created some PNGs for the images). I just attached board.png to the big image view through IB so that works fine.

Next I tried to associate cell 1 with x.png by assigning it to a variable called ximg. This is all set up in the view controller’s viewDidLoad method like so — “ximg = [UIImage imageNamed:@”x.png”];”. I then used the code “cell1.image = ximg;” — also in viewDidLoad. X appeared on the board when I built and ran.

My next step was cell 2. I wanted to use a variable in a custom method this time, so I could change it in the future. I declared a method “- (void)setcell2” (bad camelCase, I know). I put the following method into my view controller implementation file:


-(void)setcell2 {

cell2.image = ximg;

}

I also added the following message to viewDidLoad — “[self setcell2];”

As you’d guess, I was figuring that when the app loaded, viewDidLoad would send that message to setcell2, which would attach another X in the second box, but this didn’t happen.

If someone could give me some idea of what I’m overlooking, I’d be gratified. Example code is appreciated but I can figure that out with time. This is not homework. Thanks for reading!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T18:17:39+00:00Added an answer on May 24, 2026 at 6:17 pm

    Most likely you haven’t set your cell up properly in Interface Builder. Make sure you have connected the property to the outlet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I have a relative path in the web.config file. This value is
I'm a relative novice at C# and am thoroughly stuck! For a school assignment
I'm a relative novice to regular expressions (although I've used them many times successfully).
UPDATE: Relative to the questions and answers below, it seems I have a misunderstanding
I have a Flash header with a transparent background contained inside of a relative
My relative is studying programming and has a hard time understanding classes. He has
Given an absolute or relative path (in a Unix-like system), I would like to
What are the relative merits of the xdoc and apt formats for writing websites
How to get the relative path in t sql? Take for example a .sql
Whar are the relative merits between GDI+ and WPF? Also does anyone know the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.