UIView/NSView doesn't display changing data in real time

2011-04-19 Thread Frederick C. Lee
Greetings: Simple scenario: background thread is computing data to be displayed in real time within the main thread. Data: dynamic/variable data that is converted into a NSString type within a background thread, displayed within a UILabel (or NSLabel) on the main thread. My own environment:

Delegation: should be weak-linked, yet Delegating-Clients... strong linked?

2011-01-12 Thread Frederick C. Lee
Environment: OS X (10.6+) Greetings: I've always thought to weak-link delegate methods to their hosts. Hence the use of 'assign' vs 'retain' delegate assessors. Quoting Apple's Delegate documentation: Delegating objects do not (and should not) retain their delegates. However, clients of

Re: Delegation: should be weak-linked, yet Delegating-Clients... strong linked?

2011-01-12 Thread Frederick C. Lee
I suspect that to be the case when I received this code for study. Scenario: MyWindowController:NSWindowController - MyViewController:NSViewController (a delegate) Inside 'MyViewController': - (id)initWithSerial:(NSString *)_serial email:(NSString *)_email delegate:(NSObject

iOS: Rolodex Example?

2010-12-02 Thread Frederick C. Lee
Greetings: What would be the best way to emulate a rolodex of cards: each page (UIViewController) has its own tab that could be dimmed if not selected. Examples: 1) AquaMinds' Notetaker, 2) Epicurious iPad app that is currently in the iStore. I'm assuming I would have to customize the

Releasing static variable concurrent data protection questions...

2010-11-15 Thread Frederick C . Lee
Environment: OS X (10.6.5) iOS4+... Scenario: I have a static object (myNumber) that I use to accumulate a value through multiple iterations from concurrent blocks. Here's what I have learned: 1) Best way to 'share' variables is via heap vs stack. Hence, I've created a static object

Re: Releasing static variable concurrent data protection questions...

2010-11-15 Thread Frederick C. Lee
This isn't 'real code'. This is merely an attempt to learn GCD concurrency: sharing common data, etc. The reason for alloc a NSNumber is to work with the heap vs stack. I'll also be working with C structures as well. Yes, working with static int mynum is of course, much simpler. I'll peek at

Re: Releasing static variable concurrent data protection questions...

2010-11-15 Thread Frederick C. Lee
Thanks for the warning! Understood. Ric. On Nov 15, 2010, at 1:09 PM, Greg Parker wrote: On Nov 15, 2010, at 1:08 PM, Frederick C. Lee wrote: I'll peek at OSAtomic.h I'm in a learning phase, so I'll expect to 'flutter about' before I can fly. In that case, do not peek at OSAtomic.h

Re: Releasing static variable concurrent data protection questions...

2010-11-15 Thread Frederick C. Lee
toying with ObjC/C in various scenarios to learn the beast. Ric. On Nov 15, 2010, at 1:48 PM, Scott Ribe wrote: On Nov 15, 2010, at 2:08 PM, Frederick C. Lee wrote: This isn't 'real code'. This is merely an attempt to learn GCD concurrency: sharing common data, etc. OK. The reason

Re: Working with C-functions in separate NSThreads: via Stack or Heap?

2010-11-08 Thread Frederick C. Lee
, addFoot= 2 TLE name= Frederick C. Lee ... So I'll work with your (B) paradigm: keep the data 'regional' w/in a block. That way, I can pass the data amongst functions w/in a block and copy the result to the 'outside' calling ObjC object. Ric. On Nov 6, 2010, at 11:24 AM, lwj wrote

Working with C-functions in separate NSThreads: via Stack or Heap?

2010-11-04 Thread Frederick C. Lee
Environment: iOS SDK 4.2+ Xcode 3.2.5 Desired design: 1) Multiple NSThreads (via NSOperation?) running NSObjects in parallel: processing the same C-functions (with different data) in real time till conclusion (or cancelled). 2) These C-functions are located in a common *.c file (or two);

Is it possible to have a plist date to be null?

2010-09-17 Thread Frederick C. Lee
Greetings: I would like to be able to have nulled (no-value) for a data type in a plist. But I can't create an empty date entity via the Property List Editor. Question: can I have an empty value for a date, or must I resort to an empty string? Ric.

Simple instance [[alloc] init] question.

2010-08-30 Thread Frederick C. Lee
Which is the preferred method of object allocation initialization? header file.h @property(nonatomic, release) IRMSerialDetailsDO *serialIDs; ... body.m @synthesize mySerialIDDO ... // 1) self.serialIDs = [[IRMSerialDetailsDO alloc] init]; or... // 2) IRMSerialDetailsDO *mySerialIDDO =

Design Option: Exception handling vs Code Testing....

2010-06-10 Thread Frederick C . Lee
Greetings: I have a situation where I need to access a member of a mutable array (max 4 members). Sometimes I could get an out-of-bounds exception, if for example, I try to access member #3 out of a 2-member array. It's not serious, I could just ignore it and continue. Question: Is it

Preservation of State

2010-04-05 Thread Frederick C. Lee
Greetings: I wish to preserve the state of an iPhone/iTouch application; which means that I would like the application to continue deep down within a stock of View Controllers at a particular view when I return to the application. Does this mean that I need to preserve the ID of a

Accessing Regional iVars: Best Design Method

2010-03-26 Thread Frederick C . Lee
Environment: iPhone SDK 3.1+ Greetings: I wish to design a UITabBarController application where each descendent member of a particular UITabBarItem has access to its regional iVars, stored within the UITabBarItem. Hence we could multiple tabs, each having the SAME hierarchy of member view

Re: Within UITableViewCell: capturing UISegmentedControl event Row number?

2009-10-21 Thread Frederick C. Lee
I figured it out.Yes. That's how it's done. Thanks for reply! Ric. On Mon, Oct 19, 2009 at 1:17 AM, Alexander Spohr a...@freeport.de wrote: Frederick, just an idea - from UIView’s documentation: tag The receiver’s tag, an integer that you can use to identify view objects in your

Within UITableViewCell: capturing UISegmentedControl event Row number?

2009-10-18 Thread Frederick C . Lee
The Environment: (1) iPhone SDK 3.2.1 The Setup: (1) UITableViewCell is defined within its own XIB... Interface Builder (XIB): File's Owner: Table View Controller. (2) UISegmentController's Action Method is defined within the Table View Controller; along side

Programming Style: Method Definition with or without a semicolon.

2009-10-15 Thread Frederick C. Lee
1) I've seen an alternative way of defining a method, with the semicolon after the declaration, before the body: - (NSArray *)sortedIncredients; -- notice the semicolon { ... } 2) ... versus the standard declaration + body of the definition (without the semicolon): -

UIPickerView: How do I LOOP data, as is done in UIDatePicker {looping Jan thru Dec} vs a mere list?

2009-09-24 Thread Frederick C. Lee
Greetings: I have a customized UIPickerView containing a list of names. Let’s say I have an array of ten (10) names = {“Alfred”... “Zena”}. The normal way of showing this list is a singular, static list of an array from beginning to end. I would have to return to the beginning vs automatically

Why am I always getting the linker error: 'duplicate symbol'...?

2009-09-21 Thread Frederick C. Lee
I'm trying to replace #define directives with c datatype directives.Example: (1) #define x 123 versus... (2) const unsigned x = 123; I place this at the top of the .h (or .m) file, outside of any class or method as stand alone. However, every time I try to use the (2) declaration (within a .h

Re: Why am I always getting the linker error: 'duplicate symbol'...?

2009-09-21 Thread Frederick C. Lee
I suspected such.Thanks to all. I'm assuming 'const datatype' is better then the compiler directive '#define', due to the use of the compiler for more-efficient code. Hence the attempt. Regards, Ric. On Mon, Sep 21, 2009 at 2:00 PM, Jens Alfke j...@mooseyard.com wrote: On Sep 21, 2009, at

Re: Why am I always getting the linker error: 'duplicate symbol'...?

2009-09-21 Thread Frederick C. Lee
wrote: On Sep 21, 2009, at 2:15 PM, Frederick C. Lee wrote: I'm assuming 'const datatype' is better then the compiler directive '#define', due to the use of the compiler for more-efficient code. Hence the attempt. It depends. In C, a const variable of a primitive type like an integer

Re: Why am I always getting the linker error: 'duplicate symbol'...?

2009-09-21 Thread Frederick C. Lee
...@amug.org wrote: Frederick C. Lee wrote: I'm assuming 'const datatype' is better then the compiler directive '#define', due to the use of the compiler for more-efficient code. Hence the attempt. Is your code currently bogged down loading #defined literal values? If not, then why

Using Delegation in communicating data between two controllers....

2009-08-14 Thread Frederick C. Lee
Environment: iPhone (but Cocoa as well)... I was using the App Delegate as the link amongst view controllers in sharing data. The 'App Delegate', being persistent, was my 'global data' clearing house. But now I learned that this is frown upon. The preferred way is using delegation to

Re: How do I compute the screen width of a particular font?

2009-08-05 Thread Frederick C. Lee
= [[UILabel alloc] initWithFrame:centralTitleRect]; I'll try your method to see if I get the same effect. Thanks. Ric. On Wed, Aug 5, 2009 at 3:54 PM, Randall Meadows ra...@not-pc.com wrote: On Aug 5, 2009, at 1:46 PM, Frederick C. Lee wrote: Greetings:I need to adjust a UILabel's

How do I change a UITableView's row-cell's color upon user selection?

2009-08-05 Thread Frederick C. Lee
Greetings: The default selection color is blue. I want to use a different color upon user selection. Here's my code: (void)tableView:(UITableView *)theTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [theTableView

{Cocoa semi-related} Unable to de-archive an archive from SQLite.

2009-07-14 Thread Frederick C. Lee
I'm trying to dearcive sqlite3-3.6.16-osx-x86.bin. But what I get is: sqlite3-3.6.16-osx-x86.bin.cpgz Is there a remedy? Ric. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

Re: {Cocoa semi-related} Unable to de-archive an archive from SQLite.

2009-07-14 Thread Frederick C. Lee
, is not an archive. Now what?? On Tue, Jul 14, 2009 at 4:13 PM, BJ Homer bjho...@gmail.com wrote: It's not an archive; that's the actual binary executable. Just rename it to something more reasonable. I dealt with this just last week. -BJ On Tue, Jul 14, 2009 at 5:06 PM, Frederick C. Lee amourinet

Re: {Cocoa semi-related} Unable to de-archive an archive from SQLite.

2009-07-14 Thread Frederick C. Lee
Ohh! -rw-r--r--@ 1 Ric Ric 514108 Jul 14 16:45 sqlite3-3.6.16-osx-x86.bin [/Users/Ric/Downloads/tmp]chmod +x *.bin [/Users/Ric/Downloads/tmp]ls -l total 1008 -rwxr-xr-x@ 1 Ric Ric 514108 Jul 14 16:45 sqlite3-3.6.16-osx-x86.bin* [/Users/Ric/Downloads/tmp]./*.bin SQLite version 3.6.16

How do I draw a CGImage (30 sq px PNG) upon a host (larger) CGImage PNG Image at a specific coordinate?

2009-06-26 Thread Frederick C. Lee
Environment: iPhone OS 3.0 Greetings: I would like to place one or more reference icons (png) upon a host image (png) {Like a street map with legends, landmarks, etc.}. I'm working with Quartz so I'm using pre-loaded CGImages via UIImage.CGImage, for both the map/layout and the icons.

Re: Cocoa equivalent to Quartz's CGImageCreateWithImageInRect(image, imageRect);

2009-06-23 Thread Frederick C. Lee
This is for the iPhone/iTouch environment. I discovered: CGContextTranslateCTM(). I'll also check out subclassing the scrollview. Ric. On Jun 14, 2009, at 7:53 PM, David Duncan wrote: On Jun 12, 2009, at 11:53 AM, Frederick C. Lee wrote: Is there a Cocoa/iPhone equivalent to Quartz's

How do I sync Quartz drawing-path coordinates with the physical iPhone UIView coordinates?

2009-06-22 Thread Frederick C. Lee
Greetings: Here's my (common) problem: I want to be able to use Quartz to draw an open path across an CGImage layout based on the GGImage coordinates. I use the UITouch object/click via Simulator to collect my screen coordinates and hence, to plot a path for Quartz to draw:

Cocoa equivalent to Quartz's CGImageCreateWithImageInRect(image, imageRect);

2009-06-14 Thread Frederick C. Lee
Is there a Cocoa/iPhone equivalent to Quartz's CGImageCreateWithImageInRect(image, imageRect)? I want to be able to display an off-view portion; or pan over a large PNG image within the available UIView. Ric. ___ Cocoa-dev mailing list

SQLite/MySQL BLOB-creator application needed.

2009-05-28 Thread Frederick C . Lee
Greetings: I'm working within the Cocoa/iPhone environment using SQLite as my persistent storage means (albeit, MySQL would be adequate as well). I want to create a digital library that stores images as BLOBs to be incorporated into an SQLite table. So I need a simple OS X application

What's the NSMailDelivery replacement for Leopard and Beyond?

2008-06-03 Thread Frederick C. Lee
I need to send data through the mail from within my Cocoa program. This is to be for general release; so it must be stable. NSMailDelivery appear to be a candidate; unfortunately it's deprecated in Leopard+. So what does Apple intend us to use as the replacement? I've scanned the