Hi Ray,

you want to connect an Ui element that you defined in Interface Builder to your 
code, right? You may try to add the following line of code to your 
ViewController.h file:

@property (nonatomic, strong) IBOutlet UIButton *button;

where button is the name of your UIButton element. Depending on how you defined 
button in IB, there could be some variation in this line. So it might be a bit 
tricky to establish the connection by hand.I am not sure, wether there is a 
documentation about this mixed approach, since normally the developer would use 
the drag and drop method to do it.

As already mentioned, I do completely skip IB and write all neccessary things 
directly in code. For this button example, I would declare it in 
ViewController.h like this:

@property (nonatomic, strong) UIButton *button;

In ViewController.m I would declare a method for the button action:

- (void) buttonAction:(id)sender {
    // some interesting code here
}

Finally, one would create the button element either in the loadView: or 
viewDidLoad: method in ViewController.m:

// initialized the button:
self.button = [UIButton buttonWithType:UIButtonTypeSystem];
// define the action method:
[self.button addTarget:self target:@selector(buttonAction:) 
forControlEvent:UIControlEventTouchUpInside];
// set a button dimension:
self.button.frame = CGRectMake(10, 10, 88, 44);
// set a button title:
[self.button setTitle:@"Button 1" forControlState:UIControlStateNormal];
// add the button to your view hierarchy:
[self.view addSubview:self.button];

You may take a look at the references of
* UIViewController
* UIview
* UIControl
* UIButton
and some others on the iOS developer library for more details. Once you got the 
hang of it, you are much faster than clicking around in IB and Apple's 
documentation will provide you all information you need. Regrettably, most of 
the introduction documents on the Apple Developer Portal rely on Interface 
Builder, since this would be the preferred method for a sighted developer. So 
far, I haven't found a really nice introduction for a VO user. If there is 
someone out there knowing about, please let me know. There are some books 
around for this purpose. I can recommend the iPhone cook book of Erica Sadun, 
which is available on iBooks. However, it will cost a bit of money.

I hope this will help you a bit.

Greetings

Jan

---
MouseKick - The mice are coming!
Download on the App Store:
http://AppStore.com/MouseKick
---
Dr. Jan Blüher
visorApps - Accessible apps for iPad & iPhone
Bayreuther Str. 2
D-01187 Dresden
Germany

phone: +49 (0) 351 16053907
mobile: +49 (0) 176 34926242
e-mail: [email protected]
web: http://visorApps.com
Twitter: http://www.twitter.com/#visorApps
Facebook: http://www.facebook.com/VisorApps

tax number: DE281706766



Am 09.10.2013 um 20:39 schrieb Ray Campbell <[email protected]>:

> Thanks, Jan. i really like working with xcode. Where can I find some 
> documentation on how to connect controls to references in code 
> programatically?
> 
> 
> Ray Campbell
> Sent from my iPhone
> 
> On Oct 9, 2013, at 1:10 PM, "Jan Blüher, visorApps" 
> <[email protected]> wrote:
> 
>> Hi Travis and list,
>> 
>> I do use Xcode with VO for iOS development every day and really like it. 95% 
>> or something like that can be done without sighted assistence. The remaining 
>> 5% have do do with the very correct arrangement of images on the screen.
>> 
>> Although Interface Builder is quite accessible, I do not use it a lot, since 
>> I am faster with the programmatic approach. There might be other issues in 
>> Mac development that I am not aware of, but I cannot imagine them.
>> 
>> I really do encourage all people to use Xcode. It is quite hard work at the 
>> beginning, since it is a complex tool. However, once you got used to it, it 
>> is really fun.
>> 
>> Greetings
>> 
>> Jan
>> 
>> ---
>> MouseKick - The mice are coming!
>> Download on the App Store:
>> http://AppStore.com/MouseKick
>> ---
>> Dr. Jan Blüher
>> visorApps - Accessible apps for iPad & iPhone
>> Bayreuther Str. 2
>> D-01187 Dresden
>> Germany
>> 
>> phone: +49 (0) 351 16053907
>> mobile: +49 (0) 176 34926242
>> e-mail: [email protected]
>> web: http://visorApps.com
>> Twitter: http://www.twitter.com/#visorApps
>> Facebook: http://www.facebook.com/VisorApps
>> 
>> tax number: DE281706766
>> 
>> 
> <--- Mac Access At Mac Access Dot Net --->
> 
> To reply to this post, please address your message to 
> [email protected]
> 
> You can find an archive of all messages posted    to the Mac-Access forum at 
> either the list's own dedicated web archive:
> <http://mail.tft-bbs.co.uk/pipermail/mac-access/index.html>
> or at the public Mail Archive:
> <http://www.mail-archive.com/[email protected]/>.
> Subscribe to the list's RSS feed from:
> <http://www.mail-archive.com/[email protected]/maillist.xml>
> 
> As the Mac Access Dot Net administrators, we do our very best to ensure that 
> the Mac-Access E-Mal list remains malware, spyware, Trojan, virus and 
> worm-free.  However, this should in no way replace your own security 
> strategy.  We assume neither liability nor responsibility should something 
> unpredictable happen.
> 
> Please remember to update your membership preferences periodically by 
> visiting the list website at:
> <http://mail.tft-bbs.co.uk/mailman/listinfo/mac-access/options/>
> 

<--- Mac Access At Mac Access Dot Net --->

To reply to this post, please address your message to [email protected]

You can find an archive of all messages posted    to the Mac-Access forum at 
either the list's own dedicated web archive:
<http://mail.tft-bbs.co.uk/pipermail/mac-access/index.html>
or at the public Mail Archive:
<http://www.mail-archive.com/[email protected]/>.
Subscribe to the list's RSS feed from:
<http://www.mail-archive.com/[email protected]/maillist.xml>

As the Mac Access Dot Net administrators, we do our very best to ensure that 
the Mac-Access E-Mal list remains malware, spyware, Trojan, virus and 
worm-free.  However, this should in no way replace your own security strategy.  
We assume neither liability nor responsibility should something unpredictable 
happen.

Please remember to update your membership preferences periodically by visiting 
the list website at:
<http://mail.tft-bbs.co.uk/mailman/listinfo/mac-access/options/>

Reply via email to