Re: creating an NSSearchField subclass like Safari

2010-02-09 Thread Dado Colussi
On 5 February 2010 16:27, Neil Allain njall...@bluerope.org wrote:

 I'm looking to create an NSSearchField that behaves like the one in safari.
  Primarily I want the following:

 - search menu includes search matches (Suggestions) as well as recent
 searches
 - search menu opens when the user enters text that has possible matches
 (rather than just when the button is clicked)
 - search menu will update the matches while the user continues to type
 - can change focus from the text view to the menu and back with the arrow
 keys

 Honestly, it looks scary to me (but then, I'm easily scared), and my
 searches for something that already does some/all of this have turned up
 nothing.  Does anybody know of an existing implementation that does at least
 some of what I want?



This is pretty close to what you are describing: http://summerofcamino.com/

/Dado
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: make connections without InterfaceBuilder

2010-02-09 Thread Mario Kušnjer


On 2010.02.09, at 08:33, Ian Jackson wrote:

Can I just clarify, are you specifically trying to do this in code  
because you want to, or because you don't know how to make the  
connections in Interface Builder?


In interface builder control drag from the control to the  
appDelegate for the action, and from the AppDelegate to the control  
for the outlet.


Sorry if you already know this.

Ian.

On 9/02/2010, at 5:03 PM, Jonathan Chacón wrote:



Please, read first post. He specifically said that he is blind.  
Obviously, he can't control-drag.


Mario Kušnjer
mario.kusn...@sb.t-com.hr
+385957051982
mariokusnjer (at) Skype



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Older version of spotlight importer plugin still seen by mdimport -L

2010-02-09 Thread Eric Gorr
I have already filed a bug report on this ( rdar://7602076 ) and am mostly 
wondering if there is any possible workaround while keeping the spotlight 
importer in the application bundle.

Basically what is going on is that there are two different versions of the same 
application. Version 1.0 of the application has version 1.0 of the spotlight 
importer. Version 2.0 of the application has version 2.0 of the spotlight 
importer.

As I understand it, Mac OS X should only try to use the newest version of the 
spotlight importer and yet both will show up when I do a mdimport -L - I am 
assuming this is a problem.

Both spotlight importers have the same CFBundleIdentifier and denote their 
version with CFBundleVersion.

I could, of course, install the spotlight importer into /Library and make sure 
that only the latest version is there, but I like keeping them with the 
application.

Thoughts? Comments?

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Snow -- Chicago CocoaHeads/ CAWUG Feb. 9 7:00 PM @ Apple Store

2010-02-09 Thread Bob Frank
For the 5th year in a row, there is snow on the day of our February  
Meeting :-)


Take public transportation if you can.  I've already made it downtown  
and will be there tonight.  Hope to see you too.



-Bob

PS: its confirmed we're meeting upstairs on the 4th floor (yea!)



On Feb 8, 2010, at 9:52 PM, Bob Frank wrote:


Hi all,

A last minute update, the Apple Store might have a conflict on the  
2nd floor tomorrow and might be giving us up to the 4th floor for  
tomorrow night's meeting (nice!).



Please check your emails tomorrow and/or ask when you get there.   
I'll be getting confirmation tomorrow and be sending out another  
email.



-Bob



On Feb 7, 2010, at 3:45 PM, Bob Frank wrote:


Hi all,

The Chicago CocoaHeads / Chicago Cocoa and WebObjects User Group is  
holding our next meeting Tuesday, February 9th, at 7:00 PM at the  
Apple Store on Michigan Ave. [sorry for the re-sends ... had some  
email problems today]



Agenda:
- My First iPhone App: Keith Alperin
- iPad
- adjournment to O'Toole's

When:   
Tuesday, February 9th, 7:00 PM

Where:
Apple Store Michigan Avenue
679 North Michigan Ave. (at the corner of Huron  Michigan Ave.)
Chicago, IL 60611
http://tinyurl.com/Michigan-Ave-Apple-Store   (Google Maps URL)




- My First iPhone App: Keith Alperin

Or, How Keith spent his summer vacation (and fall, and winter)  
creating an iPhone app: some of what i learned developing my first  
iPhone app.  Keith Alperin is a reformed molecular biologist who  
jumped on the internet bandwagon early and left ten years later to  
start his own indie Mac and iPhone outfit: Helium Foot Software.



- A little about the iPad for iPhone developers.

We'll talk about the iPad announcement and other public information.


- O'Tooles

	Then, we will continue our discussions at our local watering hold  
Timothy O'Toole's at 622 Fairbanks (2 blocks east of the store).



Future Meeting Dates:

CocoaHeads: March 9th, April 13th, May 11th
(7:00-8:00 @ Apple Store, 2nd floor theater)

NSCoder Chicago: Feb 22nd, March 22nd
(6:00 - 9:00 @ Apple Store, 4th floor studio)


We also wish to thank the folks who run the theater space at the  
Apple store for letting us have our meetings there, and Jonathan  
'Wolf' Rentzsch for helping out so often.  Thanks all.


Also, if you are working on a project and would like to talk about  
it  briefly / promote it, I think it would be fun for people to  
hear about  other people's projects. Please email me off line and  
you can talk at  a future meeting or would like a book to review we  
would welcome that too.







--
We meet at the Chicago Apple Store on Michigan Ave.
Map: http://www.apple.com/retail/northmichiganavenue/map/

CocoaHeads meets the 2nd Tuesday of each month @ 7:00
NSCoder Chicago meets occasionally
Subscribe to the ical, both NSCoder  CocoaHeads Chicago are on the  
calendar:

http://ical.mac.com/WebObjects/iCal.woa/wa/default?u=chicagobobv=1n=Chicago-CocoaHeads-CAWUG.ics

For occasional lunch time Mac geekery go to NSLunch.org  follow  
@NSLunch on Twitter

http://www.nslunch.org/
http://twitter.com/nslunch

You received this message because you are subscribed to the Google
Groups CocoaHeads Chicago / CAWUG (Chicago Cocoa  WebObjects User
Group) group.
To post to this group, send email to ca...@googlegroups.com
To unsubscribe from this group, send email to
cawug+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/cawug?hl=en


---
Bob Frank
Senior Consulting Engineer
Apple Education Services
http://www.apple.com/education/services






---
Bob Frank
Senior Consulting Engineer
Apple Education Services
http://www.apple.com/education/services




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: always show warnings?

2010-02-09 Thread Joar Wingfors

On 8 feb 2010, at 00.05, Mario Emmenlauer wrote:

 I'm not using XCode, however it sounds likely that the object files
 are just not rebuilt? You say it happens at every build except the
 first time? The compiler will only rebuild objects that are not up-
 to-date, so you will see only the warnings for those.
 
 Are you sure you are using rebuild and not build? Try a clean
 first (or remove the output manually), see if that helps. If this is
 indeed the problem, then there is no other solution. You have to
 compile all sources in order to see all warnings, but that means you
 have to wait longer (because compiling is slow).


The restrictions and workarounds you mention here doesn't apply to Xcode 3.2 - 
Xcode now remember the last build results for all files, allowing you to see 
not only the sets of results from the last build operation, but also the latest 
sets of results for all files in the project (regardless of if they were 
processed in the last build operation or not).

j o a r


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Versioning / increasing build number

2010-02-09 Thread Jens Miltner
Just one more thought:

you could have a shell script build phase that runs whatever tool you're using 
to bump the build number and only run this when building the deployment 
configuration (e.g. by checking ${CONFIGURATION} in your script, or by 
activating the Run script only when installing checkbox in the script build 
phase, which seems to have the side effect of only executing during the 
deployment builds).

That way, your debug builds (during your development cycles) won't proliferate 
the build numbers, but any time you run a deployment build, the build number 
gets bumped...

/jum


Am 06.02.2010 um 00:58 schrieb Stefan Wolfrum:

 thanks a lot for both replies!!
 
 I don't know which approach to follow though.
 I'm currently not using a versioning system so maybe Jonathan's method is 
 sufficient.
 However, I like Gwynne's method, too...
 *sigh*
 
 But at least: problem solved!
 
 Thanks and sorry: I'll spend more time with Google next time before I ask 
 here. (And I know the Xcode mailing list now, too...)
 
 Stefan.
 
 Am 06.02.2010 um 00:09 schrieb Gwynne Raskind:
 
 On Feb 5, 2010, at 1:56 PM, jonat...@mugginsoft.com wrote:
 2) Right now the file doesn't get built new every time I build my 
 application. So the number isn't increasing yet. How can this be achieved?
 I use the following in a script phase to get a perpetually increasing build 
 number.
 
 #!/bin/bash
 # http://davedelong.com/blog/2009/04/15/incrementing-build-numbers-xcode
 buildNumber=$(/usr/libexec/PlistBuddy -c Print MGSBuildNumber Info.plist)
 buildNumber=$(($buildNumber + 1))
 /usr/libexec/PlistBuddy -c Set :MGSBuildNumber $buildNumber Info.plist
 
 
 This taints your original Info.plist with changing data, which is annoying 
 for version-controlled code. You can find the script I use at 
 http://blog.darkrainfall.org/?p=185; it's a short AppleScript that tricks 
 Xcode into doing the right thing.
 
 -- Gwynne
 
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Versioning / increasing build number

2010-02-09 Thread Dave DeLong
Another option, which I posted as a comment on my site (linked to previously), 
is to move Info.plist to Info.template.plist, and then use the build number 
script to generate the Info.plist that the compiler will actually use.  That 
way you can set an ignore on the generated Info.plist file (if you're using a 
source control system), but still have the original template plist in the 
repository.

Dave

On Feb 9, 2010, at 9:09 AM, Jens Miltner wrote:

 Just one more thought:
 
 you could have a shell script build phase that runs whatever tool you're 
 using to bump the build number and only run this when building the deployment 
 configuration (e.g. by checking ${CONFIGURATION} in your script, or by 
 activating the Run script only when installing checkbox in the script build 
 phase, which seems to have the side effect of only executing during the 
 deployment builds).
 
 That way, your debug builds (during your development cycles) won't 
 proliferate the build numbers, but any time you run a deployment build, the 
 build number gets bumped...
 
 /jum
 
 
 Am 06.02.2010 um 00:58 schrieb Stefan Wolfrum:
 
 thanks a lot for both replies!!
 
 I don't know which approach to follow though.
 I'm currently not using a versioning system so maybe Jonathan's method is 
 sufficient.
 However, I like Gwynne's method, too...
 *sigh*
 
 But at least: problem solved!
 
 Thanks and sorry: I'll spend more time with Google next time before I ask 
 here. (And I know the Xcode mailing list now, too...)
 
 Stefan.
 
 Am 06.02.2010 um 00:09 schrieb Gwynne Raskind:
 
 On Feb 5, 2010, at 1:56 PM, jonat...@mugginsoft.com wrote:
 2) Right now the file doesn't get built new every time I build my 
 application. So the number isn't increasing yet. How can this be achieved?
 I use the following in a script phase to get a perpetually increasing 
 build number.
 
 #!/bin/bash
 # http://davedelong.com/blog/2009/04/15/incrementing-build-numbers-xcode
 buildNumber=$(/usr/libexec/PlistBuddy -c Print MGSBuildNumber Info.plist)
 buildNumber=$(($buildNumber + 1))
 /usr/libexec/PlistBuddy -c Set :MGSBuildNumber $buildNumber Info.plist
 
 
 This taints your original Info.plist with changing data, which is annoying 
 for version-controlled code. You can find the script I use at 
 http://blog.darkrainfall.org/?p=185; it's a short AppleScript that tricks 
 Xcode into doing the right thing.
 
 -- Gwynne
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/davedelong%40me.com
 
 This email sent to davedel...@me.com



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: always show warnings?

2010-02-09 Thread Jeremy Pereira

On 9 Feb 2010, at 15:37, Joar Wingfors wrote:

 
 On 8 feb 2010, at 00.05, Mario Emmenlauer wrote:
 
 I'm not using XCode, however it sounds likely that the object files
 are just not rebuilt? You say it happens at every build except the
 first time? The compiler will only rebuild objects that are not up-
 to-date, so you will see only the warnings for those.
 
 Are you sure you are using rebuild and not build? Try a clean
 first (or remove the output manually), see if that helps. If this is
 indeed the problem, then there is no other solution. You have to
 compile all sources in order to see all warnings, but that means you
 have to wait longer (because compiling is slow).
 
 
 The restrictions and workarounds you mention here doesn't apply to Xcode 3.2 
 - Xcode now remember the last build results for all files, allowing you to 
 see not only the sets of results from the last build operation, but also the 
 latest sets of results for all files in the project (regardless of if they 
 were processed in the last build operation or not).

As I remember, in Xcode 3.1 there was an errors and warnings group in the 
project window.  The warnings from previous builds did persist there, 
presumably until the source file they came from was recompiled (or Xcode was 
restarted).


 
 j o a r
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/adc%40jeremyp.net
 
 This email sent to a...@jeremyp.net


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Simple Cocoa App Not Working

2010-02-09 Thread Donald Klett
I am trying to learn Cocoa and wrote a simple app using the MVC pattern.  The 
view controls two text fields, the controller receives events from a single 
button, and the model receives the value entered into the first text field, and 
then requests the view to display that value in the second text field.  I used 
IB to construct the UI and connect the view object with the text fields, and 
made the controller the target for the button.  The build is successful, but 
the value from the first text field is not copied into the second.  A printf 
shows the integer value from the first text field is zero.  Here are the short 
files.  Thanks in advance.

Don Klett


#import Cocoa/Cocoa.h
#import View.h


@interface Model : NSObject {

int value;
View* view;
}

@property (readwrite) int value;

- (void) showValue;

@end



#import Model.h
#import View.h


@implementation Model

- (id) init {
self = [super init];
view = [[View alloc] init];
return self;
}

@synthesize value;

- (void) showValue {
self.value = [view getFieldValue];
[view setResult:self.value];
}

@end

--

#import Cocoa/Cocoa.h


@interface View : NSObject {

IBOutlet NSTextField*   number;
IBOutlet NSTextField*   result;

}

- (int) getFieldValue;

- (void) setResult: (int) value;

@end

--

#import View.h


@implementation View

- (int) getFieldValue {
return [number intValue];
}

- (void) setResult: (int) value {
[result setIntValue:value];
}

@end

--

#import Cocoa/Cocoa.h
#import Model.h


@interface Controller : NSObject {

Model*  model;

}

- (IBAction) viewAction: (id) sender;

@end

--

#import Controller.h


@implementation Controller

- (id) init {
self = [super init];
model = [[Model alloc] init];
return self;
}

- (IBAction) viewAction: (id) sender {
[model showValue];
}

@end
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Simple Cocoa App Not Working

2010-02-09 Thread Hank Heijink (Mailinglists)

On Feb 9, 2010, at 9:21 AM, Donald Klett wrote:

 I am trying to learn Cocoa and wrote a simple app using the MVC pattern.  The 
 view controls two text fields, the controller receives events from a single 
 button, and the model receives the value entered into the first text field, 
 and then requests the view to display that value in the second text field.

You're actually breaking the MVC pattern here. The model should not have a 
reference to the View - that's the controller's business. The model should be 
completely agnostic of how it's displayed.

  I used IB to construct the UI and connect the view object with the text 
 fields, and made the controller the target for the button.  The build is 
 successful, but the value from the first text field is not copied into the 
 second.  A printf shows the integer value from the first text field is zero.  
 Here are the short files.  Thanks in advance.

At which point in your code did you print the value? What was in the text field 
when you saw zero being printed? Set a breakpoint in your viewAction and print 
the value of the text field. What does that tell you?

[snip]

 - (void) showValue;

That's the method that should be in the controller, not in the model. Also, the 
View instance variable should be in the controller.

 @implementation Model
 
 - (id) init {
   self = [super init];
   view = [[View alloc] init];
   return self;
 }
 
 @synthesize value;
 
 - (void) showValue {
   self.value = [view getFieldValue];
   [view setResult:self.value];
 }
 
 @end

You're missing a dealloc method - you'll leak view. Also, your init method 
isn't according to the standard. You should always check if [super init] 
returns nil. Check the Cocoa Fundamentals Guide. Same for your other classes.

 --
 
 #import Cocoa/Cocoa.h
 
 
 @interface View : NSObject {
 
   IBOutlet NSTextField*   number;
   IBOutlet NSTextField*   result;
   
 }

Pet peeve: don't name text fields with names that suggest they're model 
objects. Something like numberField would be less confusing to others.

 - (int) getFieldValue;
 
 - (void) setResult: (int) value;
 
 @end
 
 --
 
 #import View.h
 
 
 @implementation View
 
 - (int) getFieldValue {
   return [number intValue];
 }
 
 - (void) setResult: (int) value {
   [result setIntValue:value];
 }
 
 @end
 
 --
 
 #import Cocoa/Cocoa.h
 #import Model.h
 
 
 @interface Controller : NSObject {
 
   Model*  model;
   
 }

This is where your View instance variable goes.

 - (IBAction) viewAction: (id) sender;
 
 @end
 
 --
 
 #import Controller.h
 
 
 @implementation Controller
 
 - (id) init {
   self = [super init];
   model = [[Model alloc] init];
   return self;
 }
 
 - (IBAction) viewAction: (id) sender {
   [model showValue];
 }

And in this method, you ask the model for its value and you have the view 
display it.

Welcome to Cocoa, and good luck!
Hank

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


iPhone: UIWebView scroll position

2010-02-09 Thread Eric E. Dolecki
I'd like to be able to have a user tap an area which will scroll the
contents of a UIWebView to the top - but I don't see that. Do I have to
stick a UIWebView into a UIScrollView or is there an easier way?

Eric
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iPhone: UIWebView scroll position

2010-02-09 Thread Peter Blazejewicz
Hello Eric,
Can you clarify? By default when user tap status bar area embedded web
view should scroll as any other scroll-enabled views. So that's
built-in and should work with your UIWebView.
Maybe you want to execute window.scrollTo(...) simply by evaluating
JavaScript on your UIWebView instance
(stringByEvaluatingJavaScriptFromString)?
Like: [NSString stringWithFormat: @window.scrollTo(0, %d); value]?

kind regards,
Peter Blazejewicz

On Tue, Feb 9, 2010 at 8:10 PM, Eric E. Dolecki edole...@gmail.com wrote:
 I'd like to be able to have a user tap an area which will scroll the
 contents of a UIWebView to the top - but I don't see that. Do I have to
 stick a UIWebView into a UIScrollView or is there an easier way?

 Eric
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iPhone: UIWebView scroll position

2010-02-09 Thread Eric E. Dolecki
Peter,

I am not using a status bar, so I went with

[webView stringByEvaluatingJavaScriptFromString:@window.scrollTo(0,0);]

of course I don't get animation with that, so I am thinking of using jQuery
to do that.

Eric



On Tue, Feb 9, 2010 at 2:22 PM, Peter Blazejewicz 
peter.blazejew...@gmail.com wrote:

 Hello Eric,
 Can you clarify? By default when user tap status bar area embedded web
 view should scroll as any other scroll-enabled views. So that's
 built-in and should work with your UIWebView.
 Maybe you want to execute window.scrollTo(...) simply by evaluating
 JavaScript on your UIWebView instance
 (stringByEvaluatingJavaScriptFromString)?
 Like: [NSString stringWithFormat: @window.scrollTo(0, %d); value]?

 kind regards,
 Peter Blazejewicz

 On Tue, Feb 9, 2010 at 8:10 PM, Eric E. Dolecki edole...@gmail.com
 wrote:
  I'd like to be able to have a user tap an area which will scroll the
  contents of a UIWebView to the top - but I don't see that. Do I have to
  stick a UIWebView into a UIScrollView or is there an easier way?
 
  Eric




-- 
http://ericd.net
Interactive design and development
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSXML and gt;

2010-02-09 Thread Keith Blount
Hello,

I'm using the NSXML classes to write out various strings, and it seems that 
these classes convert  to lt; but not  to gt;, which I find odd. 
For instance, consider the following code snippet:

NSXMLElement*element = [[[NSXMLElementalloc] 
initWithName:@TeststringValue:@  ] autorelease];
NSLog (@%@, element);

The output is:

Testlt; amp; /Test

Is this correct, or is this a bug? Or am I missing something? Do I therefore 
need to replace all occurrences of  with gt; myself to generate better 
XML?

Many thanks and all the best,
Keith


  
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Versioning / increasing build number

2010-02-09 Thread Austin Ziegler
[I sent this reply privately to Stefan a few days ago and realized
that it hadn't come to the mailing list.]

On Fri, Feb 5, 2010 at 12:26 PM, Stefan Wolfrum mailingli...@wops.de wrote:
 Okay, found  read Chris Hanson's blog article from 2005:
 http://chanson.livejournal.com/125568.html

 I totally agree with the guy who wrote the first comment!

 So, looks like agvtool is the wrong path to follow if I want an integer build 
 number that just increases everytime
 I hit cmd-R or cmd-Y or cmd-B or variations of those.

This does more than you need if your'e not using Git, but it's a good
basis for making your own incremental versioning system. If you're
using SVN, it's fairly easy to look for svn tag version xcode.

http://github.com/halostatue/xcode-git-version

-austin
-- 
Austin Ziegler • halosta...@gmail.com • aus...@halostatue.ca
http://www.halostatue.ca/ • http://twitter.com/halostatue
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSXML and gt;

2010-02-09 Thread glenn andreas
The XML spec does not require '' to be escaped as 'gt;' (except in  
the case of ']]' when that doesn't mark the end of a cdata section).   
Only '' and '' must be escaped - see section 2.4 of XML 1.0 spec.



Sent from my iPhone

On Feb 9, 2010, at 2:19 PM, Keith Blount keithblo...@yahoo.com wrote:


Hello,

I'm using the NSXML classes to write out various strings, and it  
seems that these classes convert  to lt; but not  to  
gt;, which I find odd. For instance, consider the following code  
snippet:


NSXMLElement*element = [[[NSXMLElementalloc]  
initWithName:@TeststringValue:@  ] autorelease];

NSLog (@%@, element);

The output is:

Testlt; amp; /Test

Is this correct, or is this a bug? Or am I missing something? Do I  
therefore need to replace all occurrences of  with gt; myself  
to generate better XML?



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSXML and

2010-02-09 Thread Keith Blount
Great, many thanks for the reply, and for the location of the information in 
the XML docs, that's very helpful. Unfortunately, it seems that the NSXML 
classes don't fix the '' in the ']]' case either, though:

NSXMLElement*element = [[[NSXMLElementalloc] 
initWithName:@TeststringValue:@   ]]] autorelease];
NSLog (@%@, element);

Output:

Testlt; amp;  ]]/Test

So presumably that means that, given that the docs say gt; may be used, I am 
going to need to fix this anyway. (Even though it's unlikely the ]] 
combination will come up, I can't rule it out as this is user-generated data).

Many thanks again and all the best,
Keith


- Original Message 
From: glenn andreas gandr...@mac.com
To: Keith Blount keithblo...@yahoo.com
Cc: cocoa-dev@lists.apple.com cocoa-dev@lists.apple.com
Sent: Tue, February 9, 2010 8:52:40 PM
Subject: Re: NSXML and 

The XML spec does not require '' to be escaped as 'gt;' (except in the case 
of ']]' when that doesn't mark the end of a cdata section).  Only '' and '' 
must be escaped - see section 2.4 of XML 1.0 spec.


Sent from my iPhone

On Feb 9, 2010, at 2:19 PM, Keith Blount keithblo...@yahoo.com wrote:

 Hello,
 
 I'm using the NSXML classes to write out various strings, and it seems that 
 these classes convert  to lt; but not  to gt;, which I find odd. 
 For instance, consider the following code snippet:
 
 NSXMLElement*element = [[[NSXMLElementalloc] 
 initWithName:@TeststringValue:@  ] autorelease];
 NSLog (@%@, element);
 
 The output is:
 
 Testlt; amp; /Test
 
 Is this correct, or is this a bug? Or am I missing something? Do I therefore 
 need to replace all occurrences of  with gt; myself to generate better 
 XML?
 



  
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Running NSURLConnection from within an NSOperation?

2010-02-09 Thread Laurent Daudelin
I'm trying to run an NSURLConnection from an NSOperation. Apparently, it won't 
run. I know that NSURLConnection need a run loop. Does that mean I'll have to 
setup some kind of NSTime in my NSOperation and then call my run loop at 
regular intervals?




-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://nemesys.dyndns.org
Logiciels Nemesys Software  
laurent.daude...@gmail.com
Photo Gallery Store: http://laurentdaudelin.shutterbugstorefront.com/g/galleries

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSXML and

2010-02-09 Thread Jens Alfke


On Feb 9, 2010, at 1:03 PM, Keith Blount wrote:

Great, many thanks for the reply, and for the location of the  
information in the XML docs, that's very helpful. Unfortunately, it  
seems that the NSXML classes don't fix the '' in the ']]' case  
either, though:
NSXMLElement*element = [[[NSXMLElementalloc]  
initWithName:@TeststringValue:@   ]]] autorelease];

NSLog (@%@, element);


The  in ]] only needs to be escaped when it's inside a CDATA, I  
believe. (Since that string marks the end of a CDATA.)


—Jens___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Cocoa+OpenGL app crashes iMac

2010-02-09 Thread Shayne Wissler
I have a multithreaded Cocoa+OpenGL app that can reliably bring down
OSX. I am using the latest released/patched version of OSX, all
updates have been downloaded and applied.

The application has a thread that displays video frames as OpenGL
textures. When I resize the associated window, it crashes OSX in
various ways. Sometimes OSX just hangs. Sometimes the whole screen
goes black. Sometimes I get psychedelic colors displayed outside my
application, for instance when I click the OSX dropdown menu at the
top left corner of the screen, it displays with blasts of colors
splayed across the screen. When OSX doesn't completely die and I try
to remotely log in and kill my process with a -9 signal, OSX refuses
to kill it. I've tried using Quartz Debug, that brings down OSX
particularly hard. When OSX doesn't hang, the graphics device driver
state seems to get corrupted, even when my application has finished
running, I get the weird psychedelic colors in OSX menus and programs.

Now, I'm sure I've got a bug in my program--but nothing I'm doing
should make OSX behave this way. Fundamentally this is an OSX bug. In
any case it's difficult to find the bug when OSX comes crashing down.

Any tips?


Shayne Wissler
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa+OpenGL app crashes iMac

2010-02-09 Thread Kyle Sluder
On Tue, Feb 9, 2010 at 1:38 PM, Shayne Wissler wiss...@gmail.com wrote:
 Any tips?

File a bug at bugreport.apple.com.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Running NSURLConnection from within an NSOperation?

2010-02-09 Thread Greg Reichow

 I'm trying to run an NSURLConnection from an NSOperation. Apparently, it 
 won't run. I know that NSURLConnection need a run loop. Does that mean I'll 
 have to setup some kind of NSTime in my NSOperation and then call my run loop 
 at regular intervals?

Try using the synchronous version of NSURLConnection since you are launching it 
from within a NSOperation already-

+ (NSData *)sendSynchronousRequest:(NSURLRequest *)request 
returningResponse:(NSURLResponse**)response error:(NSError **)error


The docs mention that no special run loop configuration is necessary in this 
case.

Greg

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Running NSURLConnection from within an NSOperation?

2010-02-09 Thread Laurent Daudelin
On Feb 9, 2010, at 14:10, Greg Reichow wrote:

 
 I'm trying to run an NSURLConnection from an NSOperation. Apparently, it 
 won't run. I know that NSURLConnection need a run loop. Does that mean I'll 
 have to setup some kind of NSTime in my NSOperation and then call my run 
 loop at regular intervals?
 
 Try using the synchronous version of NSURLConnection since you are launching 
 it from within a NSOperation already-
 
 + (NSData *)sendSynchronousRequest:(NSURLRequest *)request 
 returningResponse:(NSURLResponse**)response error:(NSError **)error
 
 
 The docs mention that no special run loop configuration is necessary in this 
 case.
 
 Greg

Thanks, Greg!

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://nemesys.dyndns.org
Logiciels Nemesys Software  
laurent.daude...@gmail.com
Photo Gallery Store: http://laurentdaudelin.shutterbugstorefront.com/g/galleries

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa+OpenGL app crashes iMac

2010-02-09 Thread Jean-Daniel Dupas

Le 9 févr. 2010 à 22:38, Shayne Wissler a écrit :

 I have a multithreaded Cocoa+OpenGL app that can reliably bring down
 OSX. I am using the latest released/patched version of OSX, all
 updates have been downloaded and applied.
 
 The application has a thread that displays video frames as OpenGL
 textures. When I resize the associated window, it crashes OSX in
 various ways. Sometimes OSX just hangs. Sometimes the whole screen
 goes black. Sometimes I get psychedelic colors displayed outside my
 application, for instance when I click the OSX dropdown menu at the
 top left corner of the screen, it displays with blasts of colors
 splayed across the screen. When OSX doesn't completely die and I try
 to remotely log in and kill my process with a -9 signal, OSX refuses
 to kill it. I've tried using Quartz Debug, that brings down OSX
 particularly hard. When OSX doesn't hang, the graphics device driver
 state seems to get corrupted, even when my application has finished
 running, I get the weird psychedelic colors in OSX menus and programs.
 
 Now, I'm sure I've got a bug in my program--but nothing I'm doing
 should make OSX behave this way. Fundamentally this is an OSX bug. In
 any case it's difficult to find the bug when OSX comes crashing down.
 
 Any tips?

OS X does not support very well error in the graphic card (texture leaks for 
example can explain what you see, but trying to access via DMA to invalid large 
block of memory can too).

Launch you application with OpenGL Profiler and enable break on error to try 
to find obvious OpenGL error. If it's not enough, you can monitor your 
application (using Instrument or OpenGL Driver Monitor) to see if there is some 
abnormal VRAM usage or something like that.









___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa+OpenGL app crashes iMac

2010-02-09 Thread Shayne Wissler
Thanks for the tips, I will review my code according to your
suggestions. I did try the OpenGL profiler--that causes a kernel panic
almost instantly.


Shayne Wissler

On Tue, Feb 9, 2010 at 3:21 PM, Jean-Daniel Dupas
devli...@shadowlab.org wrote:

 Le 9 févr. 2010 à 22:38, Shayne Wissler a écrit :

 I have a multithreaded Cocoa+OpenGL app that can reliably bring down
 OSX. I am using the latest released/patched version of OSX, all
 updates have been downloaded and applied.

 The application has a thread that displays video frames as OpenGL
 textures. When I resize the associated window, it crashes OSX in
 various ways. Sometimes OSX just hangs. Sometimes the whole screen
 goes black. Sometimes I get psychedelic colors displayed outside my
 application, for instance when I click the OSX dropdown menu at the
 top left corner of the screen, it displays with blasts of colors
 splayed across the screen. When OSX doesn't completely die and I try
 to remotely log in and kill my process with a -9 signal, OSX refuses
 to kill it. I've tried using Quartz Debug, that brings down OSX
 particularly hard. When OSX doesn't hang, the graphics device driver
 state seems to get corrupted, even when my application has finished
 running, I get the weird psychedelic colors in OSX menus and programs.

 Now, I'm sure I've got a bug in my program--but nothing I'm doing
 should make OSX behave this way. Fundamentally this is an OSX bug. In
 any case it's difficult to find the bug when OSX comes crashing down.

 Any tips?

 OS X does not support very well error in the graphic card (texture leaks for 
 example can explain what you see, but trying to access via DMA to invalid 
 large block of memory can too).

 Launch you application with OpenGL Profiler and enable break on error to 
 try to find obvious OpenGL error. If it's not enough, you can monitor your 
 application (using Instrument or OpenGL Driver Monitor) to see if there is 
 some abnormal VRAM usage or something like that.










___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSXML and

2010-02-09 Thread Keith Blount
Hi Jens,

Thanks for the reply. The XML specs seem to indicate it needs escaping when it 
occurs in ]] unless it marks the end of CDATA, regardless of whether it is 
inside CDATA or not:

The right angle bracket () may be represented using the string  gt; , and 
must, for compatibility, be escaped using either  gt;  or a character 
reference when it appears in the string  ]]  in content, when that string is 
not marking the end of a CDATA section.

Am I reading that wrong?

Many thanks,
Keith


- Original Message 
From: Jens Alfke j...@mooseyard.com
To: Keith Blount keithblo...@yahoo.com
Cc: glenn andreas gandr...@mac.com; cocoa-dev@lists.apple.com 
cocoa-dev@lists.apple.com
Sent: Tue, February 9, 2010 9:37:46 PM
Subject: Re: NSXML and 


On Feb 9, 2010, at 1:03 PM, Keith Blount wrote:

 Great, many thanks for the reply, and for the location of the information in 
 the XML docs, that's very helpful. Unfortunately, it seems that the NSXML 
 classes don't fix the '' in the ']]' case either, though:
 NSXMLElement*element = [[[NSXMLElementalloc] 
 initWithName:@TeststringValue:@   ]]] autorelease];
 NSLog (@%@, element);

The  in ]] only needs to be escaped when it's inside a CDATA, I believe. 
(Since that string marks the end of a CDATA.)

—Jens



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Running NSURLConnection from within an NSOperation?

2010-02-09 Thread Keith Duncan

On 9 Feb 2010, at 22:18, Laurent Daudelin wrote:

 Try using the synchronous version of NSURLConnection […]

No, don't do this. This method simply creates a private NSURLConnection 
delegate and enters the run loop until completion or failure.

This ties the NSOperation worker thread up until completion which may shift 
thread ramp up costs onto other parts of you application.

Instead you should create a 'concurrent' NSOperation as described in the 
documentation, and schedule your NSURLConnection on +[NSRunLoop mainRunLoop]. 
This will allow your NSOperation -start method to exit immediately and the 
thread to return to the pool.

Keith___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Cocoa method to determine if application is running on iPhone

2010-02-09 Thread MARC BLATT
Is there a method for determining whether the app is running on an iPhone or 
iPod Touch?___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa method to determine if application is running on iPhone

2010-02-09 Thread David Duncan
On Feb 9, 2010, at 3:19 PM, MARC BLATT wrote:

 Is there a method for determining whether the app is running on an iPhone or 
 iPod Touch?

This is one of those questions that is always followed up with what are you 
trying to do?. Because you almost never want to ask this question directly.
--
David Duncan
Apple DTS Animation and Printing

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Running NSURLConnection from within an NSOperation?

2010-02-09 Thread Laurent Daudelin
On Feb 9, 2010, at 15:01, Keith Duncan wrote:

 
 On 9 Feb 2010, at 22:18, Laurent Daudelin wrote:
 
 Try using the synchronous version of NSURLConnection […]
 
 No, don't do this. This method simply creates a private NSURLConnection 
 delegate and enters the run loop until completion or failure.
 
 This ties the NSOperation worker thread up until completion which may shift 
 thread ramp up costs onto other parts of you application.
 
 Instead you should create a 'concurrent' NSOperation as described in the 
 documentation, and schedule your NSURLConnection on +[NSRunLoop mainRunLoop]. 
 This will allow your NSOperation -start method to exit immediately and the 
 thread to return to the pool.
 
 Keith

Thanks, Keith. I'll look into it.

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://nemesys.dyndns.org
Logiciels Nemesys Software  
laurent.daude...@gmail.com
Photo Gallery Store: http://laurentdaudelin.shutterbugstorefront.com/g/galleries

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa method to determine if application is running on iPhone

2010-02-09 Thread MARC BLATT
I wanted to have a different GUI launch when the app is running on an iPhone 
versus when it's running on the iPod Touch. The iPhone GUI would have some 
phone/3GS features available that wouldn't be available on the Touch. I was 
hoping to do a call similar to checking the OS version.

On Feb 9, 2010, at 3:23 PM, David Duncan wrote:

 On Feb 9, 2010, at 3:19 PM, MARC BLATT wrote:
 
 Is there a method for determining whether the app is running on an iPhone or 
 iPod Touch?
 
 This is one of those questions that is always followed up with what are you 
 trying to do?. Because you almost never want to ask this question directly.
 --
 David Duncan
 Apple DTS Animation and Printing
 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Simple Cocoa App Not Working

2010-02-09 Thread Graham Cox

On 10/02/2010, at 1:21 AM, Donald Klett wrote:

 I am trying to learn Cocoa and wrote a simple app using the MVC pattern.  The 
 view controls


Just to add to Hank's excellent analysis, the clue that something's amiss is in 
your second sentence here. In MVC, controllers control. The clue's in the name 
;-)

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa method to determine if application is running on iPhone

2010-02-09 Thread David Duncan
On Feb 9, 2010, at 3:31 PM, MARC BLATT wrote:

 I wanted to have a different GUI launch when the app is running on an iPhone 
 versus when it's running on the iPod Touch. The iPhone GUI would have some 
 phone/3GS features available that wouldn't be available on the Touch. I was 
 hoping to do a call similar to checking the OS version.


Check for the features you need. For example, if you need to know if tel: urls 
will work, use -[UIApplication canOpenURL:]. If you need to know if you can use 
the Camera, use +[UIImagePickerController isSourceTypeAvailable:], or if the 
camera is capable of movies check +[UIImagePickerController 
availableMediaTypesForSourceType:]. Compass can be detected via 
-[CLLocationManager headingAvailable].
--
David Duncan
Apple DTS Animation and Printing

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa method to determine if application is running on iPhone

2010-02-09 Thread MARC BLATT
Thanks. Makes sense. Will do...

On Feb 9, 2010, at 4:05 PM, David Duncan wrote:

 There is, but it is just not recommended (you can test from UIDevice). 
 Generally the concept is test for what you need because you don't know what 
 the configuration will be. Two examples:
 
 1) Someone adds a GPS unit to an iPod Touch that provides Compass heading 
 information. Should you treat the device like an iPod or an iPhone?
 
 2) Should removes the Camera from an iPhone. Should you treat it as an iPod 
 or iPhone?
 
 For this and many more reasons it makes a lot more sense to design your 
 application based on available capabilities rather than your perceived notion 
 of what is an iPhone vs iPod Touch.
 
 On Feb 9, 2010, at 3:57 PM, MARC BLATT wrote:
 
 Thanks. So I guess the answer is there's no simple [self isiPhone] or [self 
 device] call that would return a constant like the OS version. Having two 
 different devices (soon to be three) on this OS, I believe it would be a 
 useful cocoa method. Think it's worth submitting a feature request?
 
 --
 David Duncan
 Apple DTS Animation and Printing
 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSScrollView

2010-02-09 Thread Brent Smith
Hey all,
Having some trouble finding in the documentation anyway to add tick marks to an 
NSScrollView or NSScroller. Here is an image as to what I am referring to.
http://i50.tinypic.com/4h5ws4.jpg

Xcode does this when you an error on a certain line. Has anyone implemented 
this in their application, and if so, how did you go about doing it.

Thanks in advance.___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSScrollView

2010-02-09 Thread Graham Cox

On 10/02/2010, at 12:01 PM, Brent Smith wrote:

 Xcode does this when you an error on a certain line. Has anyone implemented 
 this in their application, and if so, how did you go about doing it.


I would expect that it's done using a private custom subclass of NSScroller - 
the standard control doesn't support this.

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSScrollView

2010-02-09 Thread Seth Willits
On Feb 9, 2010, at 5:03 PM, Graham Cox wrote:

 Xcode does this when you an error on a certain line. Has anyone implemented 
 this in their application, and if so, how did you go about doing it.
 
 I would expect that it's done using a private custom subclass of NSScroller - 
 the standard control doesn't support this.

It's not too hard though. I did it. Here's some code I wrote a few years ago. I 
might do it a little differently now, but it works fine and at quick glance it 
generally looks ok.



//
//  AGTickScroller.h
//  AGTickScroller
//
//  Created by Seth Willits on 6/22/07.
//  Copyright 2007 Araelium Group. All rights reserved.
//

#import Cocoa/Cocoa.h


@interface AGTickScroller : NSScroller {
NSMutableArray * _ticks;
BOOL _ticksMoveWithDocument;
BOOL _hideTicksWhenNoScrollTrack;
}

- (void)setTicks:(NSArray *)ticks;
- (NSArray *)ticks;

- (void)addTick:(NSDictionary *)tick;

@end


@protocol AGTickScrollerDelegate NSObject

@end


@interface NSScroller (PrivateMethods)
- (void)drawKnobSlotInRect:(NSRect)rect highlight:(BOOL)highlight;
@end






//
//  AGTickScroller.m
//  AGTickScroller
//
//  Created by Seth Willits on 6/22/07.
//  Copyright 2007 Araelium Group. All rights reserved.
//

#import AGTickScroller.h


@implementation AGTickScroller

- (void)dealloc;
{
[_ticks release];
[super dealloc];
}




#pragma mark -
#pragma mark Tick Management

- (void)setTicks:(NSArray *)ticks;
{
if (!_ticks) _ticks = [[NSMutableArray alloc] init];

[_ticks removeAllObjects];
[_ticks addObjectsFromArray:ticks];

[self setNeedsDisplay:YES];
}

- (void)addTick:(NSDictionary *)tick;
{
if (!_ticks) _ticks = [[NSMutableArray alloc] init];
[_ticks addObject:tick];
[self setNeedsDisplay:YES];
}

- (NSArray *)ticks;
{
return _ticks;
}




#pragma mark -
#pragma mark Drawing

- (void)setNeedsDisplayInRect:(NSRect)rect;
{
if (_ticksMoveWithDocument) {
// We need to always redraw the entire scrollbar so that ticks 
get updated appropriately
[super setNeedsDisplayInRect:[self bounds]];
} else {
[super setNeedsDisplayInRect:rect];
}
}


- (void)drawKnobSlotInRect:(NSRect)rect highlight:(BOOL)highlight;
{
[super drawKnobSlotInRect:rect highlight:highlight];

// Hack - end caps draw ontop of slot rect. They're drawn by - 
(void)drawArrow:(int)fp8 highlightPart:(int)fp12;
NSRect trackRect = [self rectForPart:NSScrollerKnobSlot];
trackRect.origin.y += 14;
trackRect.size.height -= 28;

NSScrollView * scrollView = (NSScrollView * )[self superview];
float trackHeight = trackRect.size.height;
float totalHeight = [[scrollView documentView] frame].size.height;
float offset = [[scrollView documentView] visibleRect].origin.y - 
[[scrollView documentView] frame].origin.y;

// Draw tick marks
if (!_hideTicksWhenNoScrollTrack || [self usableParts] != 
NSNoScrollerParts) {
NSEnumerator * ticksEnum = [_ticks objectEnumerator];
NSDictionary * tick = nil;

while (tick = [ticksEnum nextObject]) {
float tickPosition = [[tick objectForKey:@position] 
floatValue];
NSRect tickRect;

// Move tick rect with document
if (_ticksMoveWithDocument) {
tickRect = NSMakeRect(4, trackRect.origin.y + 
tickPosition * totalHeight, rect.size.width - 8, 2);
tickRect.origin.y -= offset;

// Ticks are fixed in scroll track
} else {
tickRect = NSMakeRect(4, trackRect.origin.y + 
tickPosition * trackHeight, rect.size.width - 8, 2);
}

// Draw Tick
if (NSIntersectsRect(rect, tickRect)) {
[[tick objectForKey:@color] set];
NSRectFill(tickRect);
}
}
}
}

@end



--
Seth Willits



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Finder style dialog to resolve NSURL bookmark data for missing file?

2010-02-09 Thread Barry Wark
I am using the new NSURL bookmark data API introduced in OS X 10.6 to
store an alias to a file system resource. When I use

+[NSURL 
URLByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:]

to resolve the bookmark data, I get nil if the file no longer exists
(or has been moved to a different volume, etc.). Since I am not
passing NSURLBookmarkResolutionWithoutUI in the bookmark resolution
options, I expected to get a dialog, like that shown by the Finder
when you open an alias file that no longer resolves (i.e. a dialog to
cancel, fix the alias, etc...).

Is there a way to have NSURL automatically prompt to reconnect/resolve
the broken bookmark data?

The bookmark data is created via:

NSError *err
NSData *bookmarkData = [myFileURL
bookmarkDataWithOptions:NSURLBookmarkCreationSuitableForBookmarkFile
  includingResourceValuesForKeys:nil

   relativeToURL:nil

error:err];

though I get the same outcome if I use 0 for the options instead of
NSURLBookmarkCreationSuitableForBookmarkFile.

I attempt to resolve the same bookmarkData via:

BOOL stale;
NSError *err
NSURL *resolvedURL = [NSURL URLByResolvingBookmarkData:bookmarkData

 options:0

   relativeToURL:nil

bookmarkDataIsStale:stale

 error:err];

Going through the dance of writing the bookmark data to a finder alias
file and then resolving the URL by reading bookmark data from that
file followed by the above method does not produce the desired UI
result either (though opening the alias file in the Finder does
produce the desired UI dialog).

Thanks,
Barry
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Cocoaheads Lake Forest (92630) meeting TOMORROW, Wed 2/10/2010 at 7 pm on whiteboarding a Cocoa Touch application

2010-02-09 Thread Scott Ellsworth
CocoaHeads Lake Forest will be meeting on the second Wednesday of the
month.  We will be meeting at the Orange County Public Library (El
Toro) community room, 24672 Raymond Way, Lake Forest, CA 92630

Please join us from 7pm to 9pm on Wednesday, 2/10.

We are going to be whiteboarding the design of an ipad/iphone
application for tracking DnD power cards.  (Other options are also on
the table...)

Our goal is to spec out the features based on the current, non-NDA
iphone SDK, along with some educated guesses as to how it will change
on the iPad.  Our desired end product is a fairly detailed look, feel,
and design.  (We are going low tech - not even a projector!)

Future sessions will build data models, create code, and generate a UI.

If you are able and willing to speak on OpenCL, Grand Central
Dispatch, Core Animation, Open GL, Mac Open Source, or Cocoa 101 for
either iPhone or Mac, please contact me.

Thanks again to everyone who came to the Google Irvine open house on
January 27th.  Follow up questions, regardless of whether you made it,
can be asked after the meeting or sent directly to me.

Bring your comments, your books, and your bugs, and we will leap right in.

As always, details and the upcoming meeting calendar can be found at
the cocoaheads web site, www.cocoaheads.org.

Scott
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Running NSURLConnection from within an NSOperation?

2010-02-09 Thread Jerry Krinock

On 2010 Feb 09, at 14:10, Greg Reichow wrote:

 I'm trying to run an NSURLConnection from an NSOperation. Apparently, it 
 won't run. I know that NSURLConnection need a run loop. Does that mean I'll 
 have to setup some kind of NSTime in my NSOperation and then call my run 
 loop at regular intervals?
 
 Try using the synchronous version of NSURLConnection since you are launching 
 it from within a NSOperation already-
 
 + (NSData *)sendSynchronousRequest:(NSURLRequest *)request 
 returningResponse:(NSURLResponse**)response error:(NSError **)error

Indeed sendSynchronousRequest: will work for a quick hack to talk to, say, your 
own server, but if you hope to some day have a real app which predictably 
handles real-world corner cases, well, let me quote what was told to me once:

The NSErrors that you get from -sendSynchronousRequest: are not documented.  
For example, if you give it a wrong  username/password combination, you get 
NSURLErrorUserCancelledAuthentication = -1012.  Apparently this is an 
implementation detail, that when it receives an authentication challenge, it 
cancels.  You're leaving the policy decisions to Apple instead of making them 
yourself, and since they are not documented, Apple may change them at any time.

It is true that the alternative asynchronous methods require a run loop.  
(Don't use a timer).

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Large queue of messages for another app

2010-02-09 Thread Trygve Inda
I have a main app and a sub-app background process (both Cocoa). The main
app needs to send the sub-app a bunch of files to process... Anywhere from
one to hundreds.

The main app has a list of paths to process in an NSArray. In my testing
with NSDistributedNotifcationCenter, it handles up to about 30... After that
it starts to lose some.

What are better options?

1) Apple Events... These are messy but I'd go there if it'd not have lost
events.

2) Write the NSArray to a file, then let the subapp just read from this file
and process them one at a time. TI could notify the subapp via a
DistributedNotifactation or it could just keep poling a private folder every
so often (yuck).

The only problem I see with this is how can I cancel one or more files from
the queue since I don't think it's a good idea to have both apps writing to
the same file.

3) Distributed Objects?  Not sure how this would work - how do my app find
each other? If I could do:

[remoteApp processDict:myDict]; // dict has a @Path key with a file path

Thaoughts?

Thanks,

Trygve


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com