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 all - I have a rack set up with a router for: -my FCP setup with DSR-40 deck -SVHS deck -my old school Avid setup -my MPEG encoding computer The "router" I have now is a dinky, 4x4 Ocean Matrix OMX-9057. This is an S-Video switcher. I've come [More]
Hi All, Excel file  created in Excel 2010 opens correctly along with edit option where the owner has created it in protect mode available in excel. But when we try to open the same in office 2013 it opens where the protected mode enable, if we click [More]
Hi, Iam doing RFC to JDBC scenario.. The receiver JDBC adapte which i configured is giving me an error saying that "Unable to execute statement for table or stored procedure. 'HR_Employee' (Structure 'Statement') due to com.microsoft.sqlserver.jdbc.S [More]
Hello, I was trying to upgrade my version of GRUB from 1.99rc~1 to the latest version (2.00-2) which was recently installed via pacman. I am using grub-bios with an GPT partition. Partition table scan: MBR: protective BSD: not present APM: not presen [More]
Hi Gurus, I'm currently designing a program that will perform auto-deletion of Purchase Orders that have no GRs after the latest Delivery Date of the PO line items. Our client is very strict in managing their purchasing activities hence the requireme [More]
Hi, I recently bought a Mac and want to convert my "Notes" from Outlook (work PC) to my Mac. I do not want to use Paralles, ideally i just want to run the info under "Mail" or any other program which works. Any idea, how i can import t [More]
Hi.  I have noticed that when I am exporting certain types of photos (for example, night photos or others dark-type shots with a lot of "crushed" blacks) from Lightroom 3 that they end up pixelated in the dark areas.  If I "Save for Web&quo [More]
I've been working on a project in Fireworks CS4 the last couple weeks, and today I cannot open the PNG file. Nothing out of the ordinary happened recently and I haven't had any issues with the software. The message I get when opening the file is "Cou [More]
After using my external USB drive as my backup target for several months I am not getting the following error: Unable to complete backup. An error occurred while copying files to the backup volume. My backup volume is an external USB formatted Mac OS [More]
I couldn't figure out what was wrong with the fonts in the HTML web galleries. They looked small, but more than that, I realized they looked nasty. Especially after making the Gallery 2 gallery, it really looked nasty. So I looked at the css file and [More]