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 ' 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 wrote: > > On Sep 21, 2009, at 1:24 PM, Kyle Sluder wro

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

2009-09-21 Thread Frederick C. Lee
fke wrote: > > On Sep 21, 2009, at 2:15 PM, Frederick C. Lee wrote: > > I'm assuming 'const ' is better then the compiler directive >> '#define', due to the use of the compiler >> for more-efficient code. Hence the attempt. >> > >

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

2009-09-21 Thread Frederick C. Lee
. Ric. On Mon, Sep 21, 2009 at 2:40 PM, Greg Guerin wrote: > Frederick C. Lee wrote: > > I'm assuming 'const ' is better then the compiler directive >> '#define', due to the use of the compiler >> for more-efficient code. Hence the attempt. >

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 c

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): - (NSA

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: View Controller. (2) UISegmentController's Action Method is defined within the View Controller; along side with: UITa

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 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 application. > @pro

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 con

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 particu

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 acc

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:

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 (Cocoa-dev

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: CG

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 Qua

How do I draw a CGImage (30 sq px PNG) upon a host (larger) CGImage 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.

{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 list.

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 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:0

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

2009-07-14 Thread Frederick C. Lee
Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> --- Done. Great! Thanks! On Tue, Jul 14, 2009 at 4:57 PM, Kyle Sluder wrote: > On Tue, Jul 14, 2009 at 4:44 PM, Frederick C. Lee > wrote: > > Now what?? > > Open up

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

2009-08-05 Thread Frederick C. Lee
Greetings:I need to adjust a UILabel's width per with of its text. What I did was to get the text's length via [NSString length]. Of course, the displayed UILabel width is too narrow to fully display the actual string. So I believe I need to compute the true width based on the number of font-

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

2009-08-05 Thread Frederick C. Lee
ILabel *titleLabel = [[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 wrote: > On Aug 5, 2009, at 1:46 PM, Frederick C. Lee wrote: > > Greetings:I need to adjust a

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 cellForRowAtIndexPath:indexPath

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

Simple instance [[alloc] init] question.

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

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. __

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); c

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

2010-11-08 Thread Frederick C. Lee
--- Output: MyBlock value: Henry, since= 3, 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 O

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 'myN

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 OS

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' befor

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

2010-11-15 Thread Frederick C. Lee
ign is better. In the meantime, I'm 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

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 th

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 de

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 *)_deleg

Re: NSURLRequest : Unable to Quit App after Syn call to Server.

2008-05-17 Thread Frederick C. Lee
Thanks for the editing. Your help is deeply appreciated! Ric. On May 16, 2008, at 10:53 AM, stephen joseph butler wrote: Your code is crashing because you have numerous pointer and memory management issues. On Thu, May 15, 2008 at 4:21 PM, <[EMAIL PROTECTED]> wrote: - (IBAction)startSOAP:(id)

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 discussion

iPhone Development: Any desktop-equiv frameworks to avoid?

2008-04-01 Thread Frederick C. Lee
Greetings: This is just a cursory question from a neophyte. Are there any desktop-equivalent libraries/frameworks that are detrimental to iPhone development? For example AppKit vs UIKit; or any particular libraries within the Foundation framework? Any opinions/discussion would further cl

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 (eit