Sitemap

Amicuk Programming Answers

Newbie question - "no property of label2 found in the interface"

-0001-11-30   Views:0

Advertisement

In the HelloWorld sample application, I added a second label. Then, in MyController.h, inside "@interface MyViewController", where label was defined as IBOutlet UILabel *label; I added a line below that IBOutlet UILabel *label2; After doing that

In the HelloWorld sample application, I added a second label.
Then, in MyController.h, inside "@interface MyViewController", where label was defined as
IBOutlet UILabel *label;
I added a line below that
IBOutlet UILabel *label2;
After doing that, in the Interface Builder, I was able to connect a line from the label to File's Owner and "label2" appeared amongst the selection there, so I made the connection. I figure I did that right.
As far as that goes, the app built and ran ok with no errors.
In MyViewController.m, however, I noticed there was a line:
@synthesize label;
I still don't understand what that means, but figured if there was one for label I ought to add one for label2 as well, so I added a 2nd line
@synthesize label2;
However, if I do that, I get a compile-time error: "no declaration of property "label2" found in the interface.
My questions are:
(1) Why do I get that error if I did, in fact, declare label2 in the interface?
(2) What does @synthesize mean anyway?
Thanks,
doug

The replay answer
Advertisement
Thanks, g.difalco.
Yes, that what was missing. When I added
@property (nonatomic,retain)UILabel *label2;
the compile error went away even with the @synthesize label2 in the MyViewController.m file. Thanks. While looking for "symmetry" with the label definition on the MyViewController.h file I overlooked that one.
Now let's see if I can wrap my mind around the rest of what you said. I am new to Objective-C, but I did read that the "dot syntax" for properties that I have been used to for years in JavaScript is a relatively recent addition to the language.
So you are saying that the @synthesize line allows that new, convenient syntax to be used.
OK. I'll go along with that. I don't know why the word "synthesize" is use for that purpose, but I will let that sink in.
Is there a reason the @synthesize line goes in the @implementation inside MyController.m rather than in the @interface in MyController.h?
Thanks,
doug

Go to See the other 7 answers

Newbie question - "no property of label2 found in the interface"

Category:DefaultRelease time:-0001-11-30Views:130

In the HelloWorld sample application, I added a second label. Then, in MyController.h, inside "@interface MyViewController", where label was defined as IBOutlet UILabel *label; I added a line below that IBOutlet UILabel *label2; After doing that[More]

Total Newbie Question ... Sorry :-(

Category:DefaultRelease time:2015-10-11Views:130

I know it's a windows thing, and I am now converted to Mac but I gotta know this because it's doing my head in. It's a complete stupid green gilled newbie question. When installing new programs on a Mac can you create shortcuts to the programs on the[More]

Newbie Question. just installed IE7.. how do I set up a local host to preview sites?

Category:DefaultRelease time:2015-10-11Views:130

Sorry for the newbie question... but it's been a long time since I have done this Thanks!Just define your site in DW as always.  For a static site, that's all you need to do.Read other 2 answers[More]

Newbie Question about FM 8 and Acrobat Pro 9

Category:DefaultRelease time:2015-10-11Views:130

Hello: I have some dcouments that I've written in FM v8.0p277. I print them to PDF so that I can have a copy to include on a CD and I also print some hard copies. My newbie question is whether there is a way to create a  PDF for hard copy where I mai[More]

Domain name settings - Newbie question

Category:DefaultRelease time:-0001-11-30Views:130

Sorry for a newbie question! I am already pointing a domain name to web hosting for email account. Now, I need an application server to run ERP software and Oracle, and installing Solaris and Oracle need a domain name. If I point my domain name to th[More]

Domain Name settings in Solaris - Newbie question

Category:DefaultRelease time:-0001-11-30Views:130

Sorry for a newbie question! I am already pointing a domain name to web hosting for email account. Now, I need an application server to run ERP software and Oracle, and installing Solaris and Oracle need a domain name. If I point my domain name to th[More]

Newbie Question:  How much computer do I need?

Category:DefaultRelease time:-0001-11-30Views:130

Newbie Question: I would like to use MainStage 3 in a live performance environment to play bars, parties, etc.  I'm not looping, using it to playback recordings, processing outboard equipment or vocal processing.  I want to stop carrying Rolands, Nor[More]

Multiple version of JRE in company..How to manage? (newbie question)

Category:DefaultRelease time:-0001-11-30Views:130

Greetings..this is a newbie question We have 48 versions of JRE running in on XP IE6 in our company. Some version beat up other JAVA applications. It's a mess. How can anyone manage this many versions? Can we consolidate down to a few versions? I saw[More]

Newbie question - XML version, searching by artist

Category:DefaultRelease time:-0001-11-30Views:130

Probably quite a common problems - apologies for newbie questions. I've changed the URL of my MP3s in my XML to a new location and refreshed my feed. Is there a way of seeing what version of the XML iTunes is using? (it takes around 24 housr to refre[More]

Newbie question: ""dynamic"" casting

Category:DefaultRelease time:-0001-11-30Views:130

Hello all, <br> I have a quite newbie question. I have this class hierarcy: <br> A |_A1 |_A2 |_A3 |_A4 |_A5 |_..... <br> in some part of my code I have this: <br><br> if (object1 instanceof A){ if (object1 instanceof A1)     [More]

Variable accessibility: newbie question

Category:DefaultRelease time:-0001-11-30Views:130

My next newbie question: The following two classes are in two separate files in the same a folder testClass2: package JavaDemos.testClass2; import java.awt.*; public class Sketcher {     static SketchFrame window;     static int widthXXX;     public[More]

Hot
Hi Friends, I have a requirement to add a new column Group Key to the existing report a standard program RFD0PR10 and display the fields based on the group key . The standard program uses methods write _header etc... can any one guide me in this issu [More]
shouldnt a MacBookPro be able to play this? I am stunned that my new Macbookpro cant play HD video content! Here is the Url, http://www.hellgatelondon.com/news/view/24/#fancy_panel I want to know is there something wrong with my Macbookpro? I plan to [More]
Hi everyone, Im hoping this is a painfully simple mistake Im making, and not a profound one. My goal is to pring out a diamond display, and this is the code Ive written so far. If anyone can point out what might be wrong with it I would appreciate it [More]
Hi friends, iam facing a problem. iam using READ_TEXT  function module to read the text in va01 for line item. name = w_test i always have same ie : vbeln & posnr   1000020012000010 vbeln = 1000020012   posnr = 000010    CALL FUNCTION 'READ_TEXT' EXP [More]
When you click on a link to a pdf a new browser window opens but its gray were the PDF is suppose to be displayed.I'm having the exact same problem.  Hopefully at some point there will be an answer????  Also, Adobe reader is not loaded as an add-in i [More]
Hi! I'm setting up a mail server on a virtual server (VMware Fusion 2.0.5) and I've a lot of problems. how to set up a mail account with the workgroup manager?? I create accounts but it doesn't appears on Server Admin in the mail service. And how to [More]
We recently had a problem with our hard drive. We ended up getting a new hard drive and then I did a restore from time machine back up. Everything seems to be working except for iPhoto. Each time I try to open it a message comes up and says that the [More]
Hi, again, I have difficulty handling tree search problems. The quesion is How to search for a node from a binary tree A, return true if found meanwhile generate the path which can be used to locate the node. I think the signature should be: // The p [More]
Hello, I have a query, select partition_name from dba_tab_partitions where table_owner='xxx'and num_rows <>0 and table_name = 'xxx'; P5 P6 P7 P12 P13 P14 P17 P18 P19 P20 P24 How can I use regular expression in above SQL query to get result without l [More]
Some (not all) of the iMovie event dates for movies stored iPhoto are incorrect. I have checked the date on the original files and in iMovie and those are correct, but the date on the iMovie event is not correct. I have some dated Dec 31 1903 and one [More]