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 of passing multiple values (Operating Unit Names) to the parameter(P_Opr_Unit) in Discoverer. I am using PL/SQL function to get the data in Discoverer.Function is working fine for multiple values from Database(SQL Dev [More]
About a week ago, i started having some major problems with my late 2009 MBP. First off all, the trackpad does not click anymore. it doesnt have the click feel like it used to. if i click on the left side of the trackpad, it will not register, and i [More]
Hi, Perhaps this an odd question but I feel like for the past 2-3 weeks on two different computers "pacman -Syu" returns "x up to date" for all repos and "nothing to do" as the result. Could nothing really be upgradeable for [More]
Hi, Is there is any report to see the list of invoice for that accounting posting has not done.Please reply ASAP. Regards PrabudhHi Go to T code VF05n and check open Billing documents and execute. System gives you the list which are pending for posti [More]
Hi experts One of my semifinished material i have routing with two operation from PP side . I add a new operation for QM inspection with Assign QM work center and assign inspection chracterestic in routing Now i have the following dout on this 1.What [More]
Hi, We are moving to 10g and I was wondering if STATSPACK is the tool (like in 9i) for performance monitoring in 10g or is there something else ? How would I install this tool? Thanks VissuHello, Yes, STATSPACK utility in Oracle10g is available and c [More]
Hi All, We have implemented custom logging in our implementation using custom Log Destinations and Locations. The log destination (inside log configurator service) we were using earlier had size of 10 mb for each file and the file count was 5. Now, a [More]
Can anyone tell me how to find the paragraph number of the insertion point in a Pages 09 document? ThanksMaybe like this: *tell front document of application "Pages"* *set C to character offset of (get selection)* *set N to 0* *repeat with P in [More]
I am developing a web application based on Oacle 10g .But after the DBServe was startedup for about 5~6 hours, the max connection process exceeded. From the DB Administration Tool it shows that there were many INACTIVE Connections which executed SELE [More]
Hi , Can anyone please guide me on how to perform a edit check when either SP or ZT partners are selected. That is i need to restrict the user to be able to make selections from only certain partner list . SAY if SP partner type then only X and if ZT [More]