Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Tools & Utilities

Reply
 
LinkBack Thread Tools Display Modes
Old 02-07-2011, 03:35 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 1
georgiabasser is on a distinguished road
Default Help! Objective C Syntax Question

I'm learning Objective C so I can develop on the iOS platform. I'm building several small tutorial apps as I learn the language and environment. I have a question about the following line of code.

UIButton* senderButton = (UIButton *)sender;

I've defined a senderButton of type UIButton* and I'm setting it equal to my sender. I know my sender is a UIButton type which will give me access to all its attributes and the associated values/data. My question is, and please forgive me as I must be really stupid, but what is the "*" after UIButton telling me??? Thanks in advance for your assistance. . .
georgiabasser is offline   Reply With Quote
Old 02-07-2011, 05:07 PM   #2 (permalink)
Indie Developer
 
iSDK's Avatar
 
Join Date: Jul 2010
Posts: 1,346
iSDK is on a distinguished road
Send a message via AIM to iSDK
Default

The star is telling you that the name of the UIButton is going to come next. This is called a pointer.

Quote:
Originally Posted by georgiabasser View Post
I'm learning Objective C so I can develop on the iOS platform. I'm building several small tutorial apps as I learn the language and environment. I have a question about the following line of code.

UIButton* senderButton = (UIButton *)sender;

I've defined a senderButton of type UIButton* and I'm setting it equal to my sender. I know my sender is a UIButton type which will give me access to all its attributes and the associated values/data. My question is, and please forgive me as I must be really stupid, but what is the "*" after UIButton telling me??? Thanks in advance for your assistance. . .
iSDK is offline   Reply With Quote
Old 02-08-2011, 06:31 AM   #3 (permalink)
Registered Member
 
Chobie's Avatar
 
Join Date: Feb 2011
Location: UK
Posts: 115
Chobie is on a distinguished road
Default

Quote:
Originally Posted by iSDK View Post
The star is telling you that the name of the UIButton is going to come next. This is called a pointer.
The star '*' denotes a pointer. It does not mean the variable name is going to follow although it usually does.
__________________
Chobie is offline   Reply With Quote
Reply

Bookmarks

Tags
interface builder, objective c, syntax, xcode

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 414
11 members and 403 guests
AppleDev, chemistry, Emy, Gi-lo, ipodphone, mistergreen2011, pipposanta, QuantumDoja, Retouchable, SLIC
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,679
Threads: 94,129
Posts: 402,924
Top Poster: BrianSlick (7,990)
Welcome to our newest member, xzoonxoom
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:25 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0