Re: iOS app launching speed

2012-05-15 Thread Dave Camp
In my experience, this is usually localized to whatever you are doing in 
applicationDidFinishLaunching and the complexity of the main nib that is being 
loaded (and it's associated data, like graphics). Usually, getting your main 
nib down to just what you need and loading the rest later goes a long way 
towards speeding up your app.

As a benchmark, you can make a new iOS project in Xcode, run it on the device, 
and compare it's launch time to your app.

Dave

On May 15, 2012, at 8:05 AM, Alex Zavatone wrote:

> Was just wondering if there are any techniques to speed up the launching of 
> iOS apps.
> 
> Back in the Director day, I would create a shell executable that would launch 
> rather quickly and present a splash screen, then an animation that indicated 
> to the user that the test of the application was loading. After that, the 
> shell read a config file, loaded the rest of the app and started up.
> 
> This approach got feedback to the user as quick as possible and provided the 
> impression of a quick launching responsive app, right from the get go.
> 
> in the case that our apps start launching sluggishly (I've seen this during 
> development sometimes) are there any approaches to take along this vein?
> 
> Thanks in advance, 
> - Alex Zavatone
> ___
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/dave%40thinbits.com
> 
> This email sent to d...@thinbits.com


___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Allocating too much memory kills my App rather than returning NULL

2011-11-09 Thread Dave Camp

On Nov 8, 2011, at 10:48 PM, Don Quixote de la Mancha wrote:

> On Tue, Nov 8, 2011 at 10:39 PM, Conrad Shultz
>  wrote:
>> And there's a bigger problem.  That memory warning notification that you
>> referenced in your first message is there to tell you that you need to
>> free up resources ASAP at run-time.  Quoting from the iOS App
>> Programming Guide:
>> 
>> "Using large amounts of memory can seriously degrade system performance
>> and potentially cause the system to terminate your app."
> ...
>> You are expected to allocate as LITTLE memory as possible, make caches
>> discardable, and play nicely with memory warnings.
> 
> That's just it.  I DON'T receive any memory warnings.  As far as I can
> tell, neither does the system send my App a UNIX signal.

This was discussed at a WWDC session a couple of years ago. If your app 
attempts to allocate a large block of memory, and the OS cannot get other 
processes to give up memory in a timely fashion, your app will be killed.

It's the reverse of you getting the low memory messages. As you take up more 
and more memory, the OS has to send the low memory messages to other apps to 
get them to release memory for you. If you allocate memory faster than the OS 
can re-claim it from other processes, your app will be terminated.

Dave___

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: Simulate touch event with cordinate?

2011-04-02 Thread Dave Camp
Since you are doing this in your own application, just get the data from your 
face tracking code and call your animation code directly. I don't think it's 
possible to create a UITouch with the public APIs.

Dave

On Apr 1, 2011, at 10:25 PM, Rikza Azriyan wrote:
> Thanks chase for your reply,
> Yes, i want to make an application like ibooks that the user can navigate the 
> page by swipe the screen, than 
>> - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
> Will respond for that swipe...
> But in my case, i don't want to make that swipe with my finger...
> I want to make that swipe by my face
> So that i want to implement my facetracking algorithm on my iphone 
> 4...detecting the face by frontcamera, and give the output result as the face 
> position cordinate.
> I'm going to use this cordinate as realtime dragging event on my PDF reader 
> as if the finger swiping in my screen. As ibooks did use finger for swipe...
> that what i want to do chase...

___

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: Assertion failure in -[MPMoviePlayerControllerNew _moviePlayerDidBecomeActiveNotification:]

2011-03-09 Thread Dave Camp
I saw that assertion yesterday in a bit of code that was accidentally calling a 
MPMoviePlayerController method from a secondary thread.

Dave

On Mar 8, 2011, at 5:01 PM, Steve Christensen wrote:

> I'm seeing the above assertion in an app running on iOS 4.2.1. It then throws 
> an NSInternalInconsistencyException with the reason: "movie player 
>  has wrong activation state (1)."
> 
> The setup has a MPMoviePlayerController instance that is playing a local 
> audio file. There is also a UIWebView whose HTML contains an  tag. 
> When the play control is tapped, I see a 
> MPMoviePlayerPlaybackDidFinishNotification notification with a reason of 
> MPMovieFinishReasonPlaybackEnded, then gdb shows the assertion failure and 
> exception and dumps the backtrace (below).
> 
> If I start playing the HTML's audio then start the MPMoviePlayerController's 
> audio, the HTML's audio fades out and the MPMoviePlayerController's plays, so 
> there's probably some subtle difference I'm missing. Any ideas what I might 
> be doing wrong or what to look at? Everything is working great except when it 
> comes time for dueling audio.

___

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: Stupid png icons

2011-01-07 Thread Dave Camp
On Jan 6, 2011, at 5:38 PM, BareFeetWare wrote:

> On 07/01/2011, at 3:04 AM, Matt Neuburg wrote:
> 
>> GraphicConverter doesn't really have the cojones to do what you need done. 
>> You want something that can use e.g. the greyness of each pixel in the 
>> original image to determine the greyness of each pixel in the alpha mask. 
>> Photoshop or GIMP will do this fairly handily. m.
> 
> Thanks for the info.
> 
> Is there no dedicated app suitable for producing PNG images with grey level 
> transparency/alpha, at the various scales needed for iOS apps (as app icons 
> in-app icons)? Does everyone just resort to GIMP and Photoshop, which seems 
> overkill and I'm guessing without templates for icon production?

You should try Opacity.

http://likethought.com/opacity/


___

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: SRV record lookup

2010-10-09 Thread Dave Camp
That would be a good question for the networking list.

Dave

On Oct 8, 2010, at 7:12 PM, Jeremy Matthews wrote:

> In one of my apps (Cocoa Desktop 10.6+ - not iOS) I need to perform some SRV 
> lookups; I know there are a few ways to do this, but I'd like to know if 
> anyone can speak from experiencefrom this link I can see that there are 
> indeed a few different methodsany ideas?
> 
> http://stackoverflow.com/questions/258284/srv-record-lookup-with-iphone-sdk
> 
> Thanks,
> jeremy___
> 
> 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/dave%40thinbits.com
> 
> This email sent to d...@thinbits.com

___

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 large image downloading

2010-08-11 Thread Dave Camp
The UIImage class docs indicate you shouldn't create images larger than 1024 x 
1024. You will either need to make sure your server will never send down an 
image larger than that, or download the image and downsample it to a reasonable 
size.

Dave

On Aug 11, 2010, at 12:46 AM, SanthoshKumarGundu wrote:

> Hi,
> 
> Can any one  have an idea of  what is the maximum  image limit(size and 
> resolution) in iphone?.
> 
> There are some images in web server. In my application , I am  getting  these 
> as NSData (one image at a time)  and displaying the image  using the 
> following code
> 
> NSData *imageData = [[NSData alloc]initWithContentsOfURL:[NSURL 
> URLWithString:imageURLString]];
> UIImage *sampleImage = [UIImage imageWithData:imageData];
> 
> This is working fine for small images ( upto  1MB of size and resolution of 
> 1024*1024).
> 
> But for large images ( 3MB size and resolution of 2500*2500), the application 
> is getting crashed.
> 
> Can any one advise me on this.

___

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: if statement causing 32 Byte leak?

2010-01-11 Thread Dave Camp
On Jan 10, 2010, at 6:51 PM, Scott Ribe wrote:

>> Just a quick note: one problem with this is false positives; you don't
>> necessarily control all the code that handles the object in question.
> 
> I think perhaps you didn't notice that he said "at -dealloc time". There is
> no case in which an autorelease pool should have a reference to an object
> when the object is being dealloc'd. At all other times of course, there may
> be references in autorelease pools which were correctly put there by library
> code after a retain.

That's just a specific instance of a stale pointer (or over-release) problem. 
If I was going to ask Apple for help here, I'd ask for a debug API that uses 
the Leaks engine to find things that still have pointers to my object at 
dealloc time. That would be a huge help sometimes.

Dave

___

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: if statement causing 32 Byte leak?

2010-01-10 Thread Dave Camp
On Jan 10, 2010, at 9:13 AM, Glenn L. Austin wrote:

> On Jan 10, 2010, at 8:01 AM, Scott Ribe wrote:
> 
>> Also, an isAutoReleased message would be worthless. At any point in time,
>> you have no idea how many times library routines that you've called might
>> have retained/released/autoreleased, nor should you care.
> 
> Actually, it would be nice to have *in a debugging context* since trying to 
> track down a pointer that is in the autorelease pool the number of times it 
> has been retained when you do a release would be very beneficial.  Yes, it 
> would slow things down, but it would sure save a lot of time when trying to 
> track down a spurious release!

"The" autorelease pool? Frequently they nest... and there could be multiple 
pools in each thread.

Dave___

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: Printing to a ipp printer discovered with bonjour

2009-12-13 Thread Dave Camp
You have to read all the IPP RFC's (plus the CUPS unique extensions) and write 
a functioning IPP client. It's not trivial, but I've done it.

Dave

On Dec 11, 2009, at 2:59 PM, Development wrote:

> I'm trying to figure out how to print using IPP from an iphone.
> I'm able to get bits of info from google but nothing so far has been overly 
> clear. I'm still trying to figure it all out.
> 
> 
> On Dec 11, 2009, at 3:07 PM, David Duncan wrote:
> 
>> On Dec 11, 2009, at 1:58 PM, Development wrote:
>> 
>>> Ok, well in my previous message I did not realize I was suppose to search 
>>> for ipp not printer. when I browse and find ipp printers I am taken to the 
>>> cups reference page. So I am wondering if there is a fairly basic guide to 
>>> printing to a cups printer from cocoa. or over bonjour?
>> 
>> 
>> What are you trying to do? Typically issue such as browsing and adding 
>> printers is done at a much higher level by the user and applications can 
>> generally be ignorant of how this all works (or if a printer is even 
>> connected to the system).
>> --
>> 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/dave%40thinbits.com
> 
> This email sent to d...@thinbits.com

___

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: NIB/XIB created objects, should they be released in -[dealloc]?

2009-11-23 Thread Dave Camp
On Nov 23, 2009, at 8:13 AM, Michael A. Crawford wrote:

> I wouldn't have though so.  I would assume that since I did not allocate them 
> directly, I don't need to clean them up.  I've just inspected some code that 
> declares properties that are marked as outlets and whose member variables are 
> allocated in the NIB file.  When the class' dealloc method is called, it 
> calls release for said properties.
> 
> I would assume this is bad form.  But I would like to know if I'm mistaken 
> and if this is valid.

Actually, that is correct. The retain/release rules for nibs are documented at 
http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html#//apple_ref/doc/uid/1051i-CH4-SW6

Note that they are different for Mac OS X and iPhone.

Dave


___

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: NSOperation and UITableVIews

2009-11-09 Thread Dave Camp

On Nov 8, 2009, at 8:35 PM, John Michael Zorko wrote:

I have an indexed table view with -- surprise -- images that take a  
long time to load. So, I put the loading into an NSOperation-derived  
subclass and have the main() method send a "refresh" msg to my main  
thread, telling it to reload the table.  This works, but the problem  
is that if the user scrolls quickly, a whole bunch of NSOperations  
get queued up, even for cells that the user scrolled far past i.e.  
they're not anywhere close to being on the screen. This has the bad  
effect of making my "refresh" msg get send for cells that have long  
since passed, making the app really slow to scroll (which really  
defeats the purpose of this whole exercise).


I would like to cancel these extra NSOperation instances, but my app  
is targeting OS 2.2.1 and:


1. I can't seem to see a way of determining if a cell is going to be  
drawn or not i.e. I don't see a way to cancel the NSOperations that  
aren't relevant to the portion of the table view that would be shown  
on the screen.


2. I thought maybe -UITableView reloadRowsAtIndexPaths would help  
(instead of calling -UITableView reloadData every time, which is why  
scrolling is so slow now), but that method is OS 3.1 only.


An alternative implementation might be to have each cell queue up an  
operation when it needs to load an image (not the view controller).  
Then, each cell could cancel it's operation in [UITableViewCell  
prepareForReuse].


Dave

___

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: Hide an Item on Desktop

2009-10-09 Thread Dave Camp

On Oct 9, 2009, at 6:50 AM, David Patrick Henderson wrote:

Depends on one's definition of "supported". One cannot rename a file  
or folder in the Finder directly with a leading '.', or a ':'.  
Attempting to do so will cause warning dialogs for all these cases  
(and perhaps of which I am unaware). So one can certainly claim that  
the Finder does not support these cases; however, the Finder will  
handle these files if created through some other medium such as a  
terminal program.


It has nothing to do with the Finder "supporting" it. Obviously the  
Finder does not display files starting with dots because it was  
designed to do so. It purposefully hides files that the average user  
does not need to see.


The Finder won't let you pre-pend a dot to the file because it  
purposefully does not show files that start with a dot. If it let you  
add the dot, the file would suddenly be hidden and a normal user (i.e.  
someone without Terminal knowledge) would have no way of getting it  
back. It's a safety feature.


Dave

___

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: Mac access to iPhone Document Directory

2009-08-18 Thread Dave Camp

On Aug 18, 2009, at 7:28 AM, Sean Kline wrote:

On Mon, Aug 17, 2009 at 9:29 PM, Clark Cox   
wrote:



On Mon, Aug 17, 2009 at 2:12 PM, The Grand Poohbah
wrote:
I'm writing a Mac application to process data for use with my  
iPhone app.

It
would be handy for development purposes to directly read from and  
write

to
my connected iPhone app's document directory. I know the Organizer  
can

read
my app's document directory and have used that, but I want to do  
it with

my

own Mac app. Is there a way to access the Document Directory of a

connected

iPhone from my home-brew Mac OS X application?


No, there isn't.

One way that I thought about doing this was to create a client/server
application that would communicate between the iPhone and Mac using  
sockets,

for example.  Would that not be possible?


Yes, your iPhone app can read/write in it's own sandbox. If you set up  
some sort of communications protocol with your application it can give  
you whatever files it can read/write.


Dave

___

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 3.0] correct way to release a UIImageView flip animation?

2009-08-09 Thread Dave Camp

On Aug 9, 2009, at 1:31 AM, John Michael Zorko wrote:

Wow, it's late ... I forgot some of the code in the last email --  
here's all of it (still not much, no worries).  I see the "program  
exited with signal:0" error after this code runs for awhile, and  
there's no backtrace.


... and I run a thread to preload the next animation (this code  
always preloads the same one, but the idea is that they'll change,  
and I don't want to load them all at once and waste memory):


First, "program exited with signal:0" suggests the app was killed by  
springboard instead of crashed on it's own. Check the device console  
log in the Organizer window and see if it was terminated for a  
specific reason. I'm going to guess you used too much memory too  
quickly. You have maybe 10 MB of RAM at your disposal on a good day  
(on a non-3GS device). Realistically, if you go over 7 MB too quickly  
(before springboard can ask other processes to terminate) your process  
will be terminated.


Second, UIKit generally isn't thread safe and UIImage is a part of  
UIKit. You probably can't safely use it from a secondary thread.


Dave


___

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] networking

2009-08-06 Thread Dave Camp

On Aug 6, 2009, at 8:30 AM, James Lin wrote:

well...I guess you can call it some sort of real time messaging  
service...


I just need to send a string from iPhoneA to iPhoneB.
And allow iPhoneB to reply with another string back to iPhoneA.

That's all I am trying to do.
I had no idea it is so difficult and involves so much.

given my state of confusion right now, any suggestion you can give  
me is much appreciated...


I think Push Notifications might be what you need. Phone A sends a  
message to the server, which uses Push Notification to send a message  
to Phone B. You can read about Push Notifications on the iPhone dev  
site (off topic for the Cocoa list).


Dave
___

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] networking-is it crippled on the simulator?

2009-08-04 Thread Dave Camp

On Aug 4, 2009, at 5:43 AM, James Lin wrote:


Hi all,

Does anyone know the limitation of the iPhone simulator when it  
comes to networking?

Is it crippled on the simulator?

I've tried two seperate ways of opening up a "server" socket.


By "server" socket, do you mean you are trying to connect to a server  
somewhere, or that you are trying to open a low numbered (i.e. < 1024)  
port locally so that you can be a server?


The simulator cannot open low numbered ports for inbound connections  
but iPhones running OS 3.0 and later can.


Dave
___

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: Avoiding KVO in dealloc?

2009-08-03 Thread Dave Camp

On Aug 3, 2009, at 6:32 PM, Kiel Gillard wrote:

On 04/08/2009, at 10:59 AM, Kyle Sluder wrote:
On Mon, Aug 3, 2009 at 5:47 PM, Kiel Gillard  
wrote:
Do you have a documentation reference for that? I would have  
expected the
isa swizzling to be an implementation detail of the runtime that  
is handled
before my subclass inits. Of course, what I expect and what  
happens in

reality do not always match ;-)


The Objective-C 2.0 Programming Guide prescribes the use of direct
ivar access inside an initializer[1] and inside dealloc[2].

[1] http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocAllocInit.html#/ 
/apple_ref/doc/uid/TP30001163-CH22-SW14
[2] http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocProperties.html#/ 
/apple_ref/doc/uid/TP30001163-CH17-SW16


Thanks for these - much appreciated. The -dealloc commentary was  
very helpful. For the OP, this means care should be taken to  
unobserve key paths before dealloc. One way this could be done by  
observing NSApplicationWillTerminateNotification.


Assuming the objects you were observing lasted as long as the app,  
yes. For anything shorter term (e.g. document data), you still need to  
know when the object will be dealloced and stop observing before then.


Dave

___

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: Challenge: Block Main Thread while Work is done, with Timeout

2009-07-24 Thread Dave Camp

On Jul 23, 2009, at 4:44 PM, Jerry Krinock wrote:

I'd often like to block the main thread while another thread or  
process performs a little task, but subject to a short timeout.  A  
few weeks ago, I was able to achieve this by "running" the main  
thread's run loop while an NSTask completed.  But I did this after  
hours of experimenting and still don't understand how it works.   
Today, when I tried to generalize the code, waiting for a little  
worker thread instead of an NSTask, my run loop just gets stuck.



The point of using a worker thread is to not block the main thread. If  
you are just going to block the main thread you might as well actually  
do the work on the main thread.


If you could post what you are trying to do here, there might be  
another way to achieve you goals without blocking the main thread.


Dave
___

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 Question: UIScrollView

2009-07-21 Thread Dave Camp

On Jul 21, 2009, at 7:34 AM, Eric E. Dolecki wrote:

I'm a real noob when it comes to the UIScrollView. What I would like  
to do:
I have a View that contains a UIScrollView. Instead of loading an  
image in
there, what I would like to do is load in another view (say an image  
that's

a lot wider than the portrait iPhone... which has button sprinkled
throughout).

So the idea is you could pan around the view, and click on points of
interest in the image (using UIButtons or whatever). But I'm not  
quite sure
how to set this up. I created a View XIB (no view controller) and  
put some

stuff in there.

NSArray *nibViews = [[NSBundle mainBundle] loadNibNamed:@"details"
owner:self options:nil];

UIView *infoView = [nibViews objectAtIndex:0];

[myScrollView addSubview:infoView];


This works, but I can't make the view wider than the iPhone  
portrait. How

should I handle this?


Right. You aren't supposed to make views larger than the screen (at  
least according to the docs). I assume that is to keep the layer sizes  
reasonable.


What you do is set the contentSize of the UIScrollView to be as large  
as you want. Then, in your delegate callbacks or UIScrollView  
subclass, you add/remove view tiles as needed to present a seamless  
view to the user. As tiles move offscreen you reuse them as new tiles  
on the opposite side.


Apple has a very nice tiled image view sample from WWDC 09 available  
online.


Dave
___

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] CFAttributedStringRef autorelease - not possible?

2009-07-21 Thread Dave Camp

On Jul 19, 2009, at 9:13 AM, Michael Hoy wrote:


NSString *m_scanString = @"This is a test.";
CFDictionaryRef emptyDic = (CFDictionaryRef)[NSDictionary dictionary];
CFAttributedStringRef attString =  
CFAttributedStringCreate(kCFAllocatorDefault,  
(CFStringRef)m_scanString, emptyDic);
CFMutableAttributedStringRef linkifiedString =  
CFAttributedStringCreateMutableCopy(kCFAllocatorDefault, 0,  
attString);
NSLog(@"%@", (NSString  
*)CFAttributedStringGetString(linkifiedString));

[(id)linkifiedString autorelease];

Testing in a Mac OS 10.5 SDK, this code works. In the iPhone 3.1  
SDK, the last line of code (calling autorelease on  
CFMutableAttributedStringRef) gives EXC_BAD_ACCESS. Everything else  
works as expected.


Is CFAttributedStringRef not castable to id or NSObject* in the  
iPhone environment?


Attributed strings are not supported on the iPhone.

Dave
___

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] Encrypting data of an iPhone Application / Converting J2ME App functionality

2009-07-16 Thread Dave Camp
You might have better luck posting to the CDSA list (it's for crypto  
and security issues).


Dave

On Jul 16, 2009, at 3:13 AM, Tharindu Madushanka wrote:


Hi,

The Java application uses RC4 Encryption. Could some one help me to  
encrypt
a String with CommonCrypto. I think we can use CCCrypt function to  
do this.

Can anyone point some way.
I have worked on below code to encrypt a string. But it did not seem  
to be

working.


___

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 camera control like RedLaser

2009-07-08 Thread Dave Camp
Due to the dynamic nature of Obj-C, there really isn't a good way for  
Apple to detect most private API uses.


Dave

On Jul 8, 2009, at 7:05 AM, Roland King wrote:

Is this the RedLaser app I just found on the store? I can't think  
that Apple would approve an app which used a private API.



On Jul 8, 2009, at 9:56 PM, Luke Hiesterman wrote:


There is no API for that at this time.

Luke

Sent from my iPhone.

On Jul 8, 2009, at 12:00 AM, Mike Manzano
 wrote:


The RedLaser app overlays a display on the 3GS' video capture
screen, and seems to be able to react to the video in real time. Are
they using public APIs to do this? If so, I can't find them.

Mike


___

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: NSTask & curl

2009-06-07 Thread Dave Camp

On Jun 6, 2009, at 3:18 PM, Ammar Ibrahim wrote:


On Sun, Jun 7, 2009 at 1:09 AM, Bill Bumgarner  wrote:


On Jun 6, 2009, at 3:05 PM, Ammar Ibrahim wrote:

Thanks that fixed it! Although when you call it directly from the  
command

line, it's fine to have the space there!



I'd argue that fixed a symptom, but not the problem.

As others have said, launching a task to execute curl is just about  
as

wasteful and inefficient as you can get.

What others haven't mentioned is that it is also a potential  
security hole
or source of confusion for your users.  Namely, packing up command  
lines and

then executing sub shells is rife with fragility and security issues.


I do agree, but I really need to use curl, and this is not a  
product. It's

for a controlled environment. I will entirely replace curl later.


If you really need to use curl, you should probably link against  
libcurl and use the code directly. The API is quite easy to work with.


Dave
___

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] Zooming & Dragging a PDF Inside a UIScrollView

2009-05-22 Thread Dave Camp
If all you want to do is display a PDF, just use a UIWebView. It will  
display the PDF just like Safari with scrolling and whatnot and handle  
everything for you.


Dave

On May 22, 2009, at 10:35 AM, Bob Barnes wrote:


Hi,

  I'm new to both Cocoa and iPhone so perhaps I've taken on  
something too complicated for a beginner, but I'm trying to display  
a PDF in a UIScrollView so that I can zoom/drag, etc. I've created a  
view hierarchy with a main UIView (probably should be a  
UIViewController, but that's another conversation) that has 3  
subviews, a UIScrollView and 2 other UIView objects used to hold  
custom controls. I've created a PDFView as a subclass of UIView and  
add it as a subview of the UIScrollView. The actual drawing of the  
PDF is done in the drawRect  method of my PDFView object using the  
Quartz 2D PDF drawing calls. The zooming and dragging work, however,  
when I scroll the view it drags too far, exposing the background of  
my view. I had assumed that setting the contentSize of the  
UIScrollView to the size of the zoomed PDF would prevent the PDFView  
from moving away from the edge of the view, but I'm apparently  
missing something.


  Can someone point me to some sample code that illustrates the  
proper technique for drawing a PDF inside a scroller or perhaps  
offer some suggestions on what I might be overlooking?


Bob___

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/dave%40thinbits.com

This email sent to d...@thinbits.com


___

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: Xcode 3.1.3 console output broken

2009-05-10 Thread Dave Camp
Since Xcode 3.1.3 is pre-release software, it's under NDA and you  
can't discuss it here.


Try 

Dave

On May 9, 2009, at 7:19 PM, sk wrote:


Hello,

Today has been a headache - first my upgrade to xcode 3.1.3 trashed  
all my certs/provisions. After two attempts, I got them fixed.


Now, I'm dealing with the issue in the subject, no console output.
Absolutlely nothing is getting printed to the console - No startup  
info, not when I "print" a variable from xcode when stopped on a  
breakpoint,

not NSLog() either.

Nothing.

I've restarted my Mac, restarted Xcode, etc. I've made it so clears  
the console and opens it on project build. I had GDB log to a file,
and that works, so the plumbing is cool. Its just the console itself  
is dead.


Image: (and this is after attempting to print the contents of a  
variable while the app is running)

http://mr-sk.com/iphone/screen-capture-2.png

It doesn't seem to matter if I'm on the device or the simulator ...

Thanks for any help,

- sk
___

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/dave%40thinbits.com

This email sent to d...@thinbits.com


___

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] Grouped TableView baffling problem

2009-05-08 Thread Dave Camp
Instead of running and letting it load the debugger on crash, start it  
with the debugger in the first place (Cmd-Y). Depending on the  
problem, if the debugger loads after-the-fact you may not get a lot of  
helpful information in the console log.


Dave

On May 8, 2009, at 1:04 AM, James Lin wrote:


Hi,

I have a table view with 3 grouped sections. Each section contains  
only one item.

There is a baffling problem i don't have a clue what went wrong.

if any one of the single row in any section is selected for the  
first time.

All is well, the correct next view will get pushed without problem.

but if i select the back button and come back to the table view and  
try to select the same or another row.

I get dropped into the debugger with the following message:

Loading program into debugger…
GNU gdb 6.3.50-20050815 (Apple version gdb-962) (Sat Jul 26 08:14:40  
UTC 2008)

Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and  
you are
welcome to change it and/or distribute copies of it under certain  
conditions.

Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for  
details.
This GDB was configured as "i386-apple-darwin".warning: Unable to  
read symbols for "/System/Library/Frameworks/UIKit.framework/ 
UIKit" (file not found).
warning: Unable to read symbols from "UIKit" (not yet mapped into  
memory).
warning: Unable to read symbols for "/System/Library/Frameworks/ 
CoreGraphics.framework/CoreGraphics" (file not found).
warning: Unable to read symbols from "CoreGraphics" (not yet mapped  
into memory).

Program loaded.
sharedlibrary apply-load-rules all
Attaching to program: `/Users/linjames/Library/Application Support/ 
iPhone Simulator/User/Applications/541FCE53-8B6A-4878-BD9B- 
FDAE34C62CB1/KindredSpirit.app/KindredSpirit', process 21184.


as you can see, this doesn't help tell me what went wrong...am I  
missing something?


___

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: 3 iPhone SDK Questions

2009-04-15 Thread Dave Camp

On Apr 15, 2009, at 12:54 PM, Steve Cronin wrote:


I haven't stuck my toe in the iPhone water yet.
I know I could find the answers to these by digging but I've been  
asked to find out the answers quickly...


1) Does the iPhone support the Cocoa AddressBook.framework?  If so,  
do the AB change notifications also work?
2) We believe that the iPhone does NOT support AppleScript, is there  
any inter-application communication mechanism?
I'm not sure if this last one is under NDA or not.  If so then just  
let me know!
3) Is there any way for application X to examine the pasteboard from  
a copy event in application Y?


Questions 2 and 3 are somewhat moot because you cannot have two user  
applications running at once (well, not for more than about 5 seconds).


Dave
___

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: The efficiency of swapping endianness on an iPhone?

2009-04-14 Thread Dave Camp

On Apr 14, 2009, at 5:22 PM, Harry G wrote:

Hi, I'm currently writing an app for iphone that downloads large  
tables of text and images , and my server outputs big endian.


How significant would the extra processing be to convert to small  
endian on the iPhone?


I'm sure most of you would recommend doing the conversion on the  
server side, but the guy in charge of the server is having time off,  
so looking at alternative possibilities.


The answer probably depends on the amount of data you are working on...

Your best bet would be to implement it on the phone and then use Shark  
to measure performance.


Dave

___

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: kern/locks.h

2009-04-07 Thread Dave Camp

On Apr 7, 2009, at 10:08 AM, Barry Fawthrop wrote:


Michael Dautermann wrote:

Thanks Michael
Can you suggest some learning resources on how to (a) learn more and  
(b) accomplish an iPhone "acceptable" locking mechanism for the  
iPhone.


For ported code, the pthreads library might be what you need.


And seeing your domain is mac.com
Can you suggest why the Kernel framework was not developed for the  
iPhone ?
I have also noticed that the Kerberos framewotk was also not  
developed for the the iPhone either.


Anyone with a Mobile Me account has a .mac.com address...

Dave
___

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 Tab bar Question

2009-03-24 Thread Dave Camp

On Mar 24, 2009, at 8:32 AM, Jason Todd Slack-Moehrle wrote:


My question is how do I modify the tab bar at the bottom to not  
make space for an image. I dont want to use images and I dont see  
how to adjust the height of the bar so I gain some extra space.


You can't.


Where does one find icons they want to use? I am by far not a  
graphic designer!


Well, if the built in icons that are accessible in IB are not  
suitable, and you can't make your own, you hire a graphic designer...


Dave
___

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 Tab bar Question

2009-03-24 Thread Dave Camp

On Mar 23, 2009, at 6:02 PM, Jason Todd Slack-Moehrle wrote:

I created a standard iPhone application using the built-in wizard  
and it builds and runs fine.


My question is how do I modify the tab bar at the bottom to not make  
space for an image. I dont want to use images and I dont see how to  
adjust the height of the bar so I gain some extra space.


You can't.

Dave
___

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: What is using up so much memory here?

2009-03-10 Thread Dave Camp
Well, since you obviously can't have all of those images on screen at  
the same time at full size, you should either just load what you need  
or resize them to a more appropriate size.


Dave

On Mar 10, 2009, at 4:41 PM, James Cicenia wrote:

Interesting... I didn't know that, but then it begs the question  
what do the cool kids do?
Should I be taking a different approach here? If so, any pointers or  
doc chapter would be

great.

Thank you
James Cicenia



On Mar 10, 2009, at 6:33 PM, David Duncan wrote:


On Mar 10, 2009, at 4:26 PM, James Cicenia wrote:


Ok -

Here is the offending code that sucks up about 2MB:

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
while(thisState = [statesEnum nextObject]){
	UIImageView *singleStateView =  [[[UIImageView  
alloc]initWithFrame:CGRectMake(2,0,  293, 184)]autorelease];
	[singleStateView setImage: [UIImage imageNamed:[[@"wf-map-gray-"  
stringByAppendingString:thisState 
]stringByAppendingString:@"_glow.png"]]];

[singleStateView setTag:100];
[fruitStateView addSubview:singleStateView];
}
[pool release];

These are little pngs of the states. They are tiny 4KB images
yet when this loop runs it winds up taking up an additional 2MB



Compressed size does not matter. Your images (or at least your  
image views) are 293x184, which means that each view is going to  
consume 293x184x4 (bytes per pixel) = 210.6K. I presume your  
looking at the Memory Monitor tool, as the memory used by view  
backing stores is not reflected in the memory usage as reported by  
the ObjectAlloc tool, but assuming your PNGs are the same size as  
the view, that 210.6K number is far more indicative of memory usage  
than the compressed size.

--
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/dave%40thinbits.com

This email sent to d...@thinbits.com


___

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: What is using up so much memory here?

2009-03-10 Thread Dave Camp

On Mar 10, 2009, at 4:26 PM, James Cicenia wrote:


Here is the offending code that sucks up about 2MB:

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
while(thisState = [statesEnum nextObject]){
	UIImageView *singleStateView =  [[[UIImageView  
alloc]initWithFrame:CGRectMake(2,0,  293, 184)]autorelease];
	[singleStateView setImage: [UIImage imageNamed:[[@"wf-map-gray-"  
stringByAppendingString:thisState 
]stringByAppendingString:@"_glow.png"]]];

[singleStateView setTag:100];
[fruitStateView addSubview:singleStateView];
}
[pool release];

These are little pngs of the states. They are tiny 4KB images
yet when this loop runs it winds up taking up an additional 2MB


Well, the PNG files are 4KB. The images are approximately 215KB when  
decompressed (293 * 184 * 4 bytes/pixel = 215,648). Probably slightly  
larger when the rows are padded out (assuming the PNG images are the  
size of the view you are creating in the code you supplied).


Dave
___

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: creating a printer

2008-10-12 Thread Dave Camp

On Oct 12, 2008, at 6:54 PM, Scott Ribe wrote:


But how do I add a printer to the system? Any pointers to the right
docs?


I think you'll have to use lpadmin, via NSTask, and it's not  
particularly
easy to figure out the right options without knowing a good bit  
about CUPS,

which I don't...


You can do it programatically by sending IPP requests directly to the  
CUPS server (which is how the lpadmin tool does it) via libcups.


Point your bowser at http://localhost:631 to get documentation on  
libcups.


To see what requests lpadmin makes to create printers, grab the CUPS  
source from the Darwin repository or download a snapshot from cups.org.


Dave
___

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 [EMAIL PROTECTED]


Re: Initializing font size in UITextField

2008-06-15 Thread Dave Camp

On Jun 15, 2008, at 3:30 PM, Mike Westerfield wrote:

I'm trying to set the font size in a UITextField that is created  
using Interface Builder in the iPhone SDK. I'm new to Cocoa, so  
there may be something obvious I'm missing.


The first thing you are missing is that the SDK is under NDA and you  
can't talk about it on public forums. :-)


Dave

___

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 [EMAIL PROTECTED]


Re: Problems with Launchd Daemon

2008-04-28 Thread Dave Camp


On Apr 28, 2008, at 12:00 PM, JanakiRam wrote:
I am developing a Mac cocoa application suite which has a launchd  
daemon (

which is a pure cocoa application ).

I'm able to launch the cocoa daemon using launchctl command  
properly. But
when i place the plist in /Librart/LaunchDaemons ,after  system  
restart ,
my system log shows the following error. And my application behavior  
is

unexpected.

*: 3891612: (CGSLookupServerRootPort) Untrusted apps are not
allowed to connect to or launch Window Server before login.*

*: kCGErrorRangeCheck : On-demand launch of the Window Server  
is

allowed for root user only.*

*_RegisterApplication(), FAILED TO establish the default connection  
to the

WindowServer,_CGSDefaultConnection() is NULL. *

Activity Monitor  shows my daemon  is running with root privileges.

Can any one help me to solve this problem. Please help me to solve  
this

problem.


You should read , if you have not already.


You can write a daemon in Objective-C and use Foundation and other  
daemon safe frameworks, but you can't use AppKit or the Cocoa  
framework. It's hard to tell what you mean by "pure cocoa" application.


Dave



___

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 [EMAIL PROTECTED]


Calling NSNumber class methods on NSDecimalNumber

2008-04-22 Thread Dave Camp
After some testing, it appears that calling NSDecimalNumber with class  
methods of it's NSNumber parent class return the expected  
NSDecimalNumber object. For example, [[NSDecimalNumber  
numberWithDouble:1.1] isKindOfClass:[NSDecimalNumber class]] returns  
YES (and the resulting object has the correct value)


The problem is that I get the warning "initialization from distinct  
Objective-C type" when I do this, because the NSNumber class methods  
return a specific type instead of id.


My question is: is this a bug in the NSNumber headers that I should  
report, or is this unsafe code and I shouldn't be doing this?


Thanks,
Dave


___

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 [EMAIL PROTECTED]


Re: [OT: security] smbclient

2008-04-15 Thread Dave Camp

On Apr 15, 2008, at 12:52 PM, Stuart Malin wrote:
[sorry to post here, but I don't know what other list might be  
better/more appropriate]


I'd suggest the network list, since it's a network question...

Dave
___

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 [EMAIL PROTECTED]


Re: System Preferences window is wider in Leopard? How do you make a Tiger compatible UI?

2008-04-10 Thread Dave Camp

On Apr 10, 2008, at 3:06 PM, E. Wing wrote:

On 4/9/08, Dave Camp <[EMAIL PROTECTED]> wrote:

After designing the UI for a new System Preferences pane I've
discovered that the window size in Leopard is 75 pixels wider than it
was in Tiger or earlier OS releases. The net result appears to be  
that

my shiny new UI is clipped on the right side in Tiger. Ugh. I've sent
feedback that the docs are incorrect here and need to be updated...

In the mean time, what is the correct way to handle this?



There's a Developer example that shows how to handle this (create two
different views, one for each version).
http://developer.apple.com/samplecode/PrefsPane/index.html


That's not an option for me, I've got way too many views (it's a  
rather substantial pref pane).


For the moment, I'm going with making the window wider while my pane  
is active... I might re-evaluate adding code to manually resize  
various bits of UI at a later date. It's a non-trivial task.


Thanks,
Dave
___

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 [EMAIL PROTECTED]


System Preferences window is wider in Leopard? How do you make a Tiger compatible UI?

2008-04-09 Thread Dave Camp
After designing the UI for a new System Preferences pane I've  
discovered that the window size in Leopard is 75 pixels wider than it  
was in Tiger or earlier OS releases. The net result appears to be that  
my shiny new UI is clipped on the right side in Tiger. Ugh. I've sent  
feedback that the docs are incorrect here and need to be updated...


In the mean time, what is the correct way to handle this?

From what I've read on the net adding springs in IB doesn't help.  
Would it be safe for me to resize the preferences window to be 75  
pixels wider on Tiger while my pane is visible (and size it back down  
when my pane is deselected)?


Do I have to make my UI narrower and have an obnoxious amount of dead  
space around the edges on Leopard?


Thoughts?

Dave

___

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 [EMAIL PROTECTED]


Re: Cocoa way to get list of user accounts?

2008-03-11 Thread Dave Camp

On Mar 10, 2008, at 11:00 PM, Mac QA wrote:


I am seeking the nice clean Cocoa way of getting a list of user
accounts on the local system. Ultimately in the form of an NSArray of
NSStrings of user account short names. There must be a way without
parsing obscure system files, or spawning off NSTasks and parsing
output, right? Any and all suggestions greatly appreciated. Thanks!


On Leopard, the new Identity Services API might be what you are  
looking for.



Dave

___

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 [EMAIL PROTECTED]


Re: Presumably iphone does Objective-C 2.0?

2008-03-06 Thread Dave Camp
That's not what he was asking. He was specifically asking about  
Objective-C 2.0. It has functionality not present in previous versions  
of the language.


Dave

On Mar 6, 2008, at 2:48 PM, Conrad Taylor wrote:

Hi, I'm sure that iPhone has always done Objective-C because the  
iPhone is

running a core version of the Mac OS X operating system.
-Conrad

On Thu, Mar 6, 2008 at 2:34 PM, Robert Nicholson <[EMAIL PROTECTED] 
>

wrote:


So given that Core is supported by the iphone are all the Objective-C
2.0features supported too?

So you can write iphone apps that use GC should you so wish?

I've yet to see the SDK which hopefully will answer these questions.

also given so much overlap b/w iphone SDK and Cocoa SDK do they  
coexist
together nicely or can you get by with existing tools plus  
frameworks plus

simulator?

Don't see any reason to have two copies of Xcode, IB etc just to do  
iphone

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/conradwt%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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/dave%40criticalpath.com

This email sent to [EMAIL PROTECTED]



___

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 [EMAIL PROTECTED]


Re: How to get an NSString from a non-terminated array of unicode chars (length is known)

2008-03-04 Thread Dave Camp


On Mar 3, 2008, at 11:00 PM, Stuart Malin wrote:

My problem is that I receive a function call from a C library that  
gives me a wchar_t array and its length. The unicode array is _not_  
terminated.


The library defines an XML_Char type, so my code below refers to  
that, but XML_Char is wchar_t (which, I believe is UTF8 on a Mac).


You actually have two problems here:

1) wchar_t on the Mac is a 4 byte per character container (32 bits).

2) wchar_t is just a container, it does not define the encoding of the  
character it contains.


So, you need to know exactly what the encoding used in your container  
is before you can get it converted to an NSString of a known encoding.


NSString infers the width of the characters from the encoding. If you  
have a buffer of characters where the width does not match the  
encoding you will probably have to re-buffer the characters into the  
correct width before handing them to NSString.


If you are correct in that you have a piece of code that has UTF8 in a  
wchar_t string (which would be horribly inefficient, wasting 3 bytes  
per character in the string) you might need to write some code that  
copies every 4th byte from the wchar_t string into a UTF8 buffer that  
you can then use as input to NSString.


Dave

___

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 [EMAIL PROTECTED]


Re: Using NSPredicate to parse strings

2008-03-03 Thread Dave Camp

On Mar 3, 2008, at 10:12 AM, Jonathan Dann wrote:

On 3 Mar 2008, at 16:16, Mike Abdullah <[EMAIL PROTECTED]>  
wrote:


Jonathon, you'll have much better luck with NSScanner. It's  
designed for exactly what you want.


Mike.


Thanks Mike, just tried it and it works quite well.  Any way of  
using NSScanner directly with regex? Not sure if its really  
necessary for my code but would probably be very useful,  
alternatively I'll just use NSPredicate to avoid scanning for stuff  
that isn't there.


I'd highly recommend 

Dave

___

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 [EMAIL PROTECTED]