a bug in iphone SDK's creation of view based xib files.

2009-09-01 Thread jon
a bug in iphone SDK's creation of view based xib files.  (this is  
using 3.1,  but other's probably apply)

steps to reproduce.

step 1.

create a new iPhone View-based Application in Xcode.

step 2.

add a new Class..   "Cocoa Touch Class"   of UIViewController subclass.

step 3.

be sure to include the "option" of "with XIB for user interface."

step 4.

open the newly created XIB file in interface Builder.   (change the  
view's back ground color to some color that you can see easily if  
incorrectly placed in the iphone simulator)


step 5.

under the view size tab in the inspector of interface builder of this  
newly created "view" in the XIB,  you will find it impossible to  
adjust the "stretch" arrows of the autoSizing.. .


so if you compile a working app that can be rotated in the iphone  
simulator.  (you will need a working app that can rotate the view in  
the iphone simulator)


  (and have the app's view  in the simulator rotate automatically),  
you will see that the view is no longer sized correctly (in the iphone  
simulator).  (you will see the background color in the wrong places)




the part that is wrong, and can be corrected:

inside the newly created XIB file,  you will find a line "key="NSvFlags">256" (or something similar for the number)


this makes it impossible to change the autoSizing arrows to stretch  
the "view" of the new xib in interface builder...  (notice the first  
xib file in the new project is set correctly,  but this new xib you  
create with tne new class is incorrect)


if you change it instead to ""274"   then  
you regain the function of being able to size your view in the  
"autosize" area,  and be able to rotate your view automatically in the  
running app's iphone simulator.


this "key" should be changed so that you can change the stretching  
ability to the programers preference,  which is some other code that i  
do not know at this time.  the code given hard wires the auto stretch  
permanently...  the incorrect code turns off auto stretch  
permanently   but the correct code should make it the programers  
option to have stretching or no stretching...


Jon.
___

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: a bug in iphone SDK's creation of view based xib files.

2009-09-03 Thread jon

Hi Joey,

On Sep 3, 2009, at 12:15 AM, Joey Hagedorn wrote:

Please do not discuss unreleased software on this list. You have  
access to the developer forums which are an appropriate place to  
discuss issues you may have. The issue you're discussing applies to  
iPhone OS 3.0 as well, so I'll continue to answer.


opps,  that should have said 3.0 only  (i did file a bug report,   
i should have also said i had filed a bug report  in the listing,   i  
only put it on the list, because i also mentioned a work around)



he springs and struts are disabled on views with simulated user  
interface attributes, so this is expected...In this case, it  
sounds like you expect the view provided in the UIViewController  
Subclass with XIB file template to have the autosizing parameters  
set differently.


if this were not a bug,   then why is the First XIB created (which is  
a UIView class also)  set differently than the Second XIB which is  
also the same Class??  ( I should have mentioned in the steps that  
this is not a UIViewController subclass,  that option should be left  
off to create a regular "UIView" Class...)and should provide  
exactly the same start point,  since they after all should be the  
same, yet they are not the same???
one has the struts/springs set differently than the other
worse,  disabled, so that no one can change them to be correct.


 on the first XIB,  the Simulated Status Bar is not disabled either  
in any case,  yet the size options (struts and springs) are set  
differently than the second XIB


(a second related thing is:)  setting the Simulated Status Bar to  
disabled,  does not actually disable the status bar,  (it does inside  
of IB,  but inside the iPhone simulator after it is compiled, it does  
not)  one has to also edit the XIB to actually turn off the Status  
bar??  (maybe  i am missing something there)


this can be verified by simply creating a new project of "View based"  
class,   then inside IB,   set status bar to "none" on the UIView  
XIB,   then compile and run in simulator,   the status bar is still  
there.  even if it is disabled on the main XIB too.  (unless i am  
confused about the option of disabling the status bar).



which brings up another question?  why does it matter that the status  
bar be there or not?   shouldn't you be able to adjust struts and  
springs no matter if it is there or not?   if one rotates the view,   
the status bar rotates in the iphone simulator,   shouldn't the view  
also rotate and adjust it's view appropriately?  right now that is not  
happening  shouldn't it for the second XIB view,  just like the  
first XIB view does correctly.  (even if the status bar is there, the  
first one is set correctly)


Thanks,
jon.
___

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: a bug in iphone SDK's creation of view based xib files.

2009-09-03 Thread jon


On Sep 3, 2009, at 6:21 AM, jon wrote:

 I should have mentioned in the steps that this is not a  
UIViewController subclass,  that option should be left off to create  
a regular "UIView" Class...)


correction, that should have said:   "that this is not a  
UITableViewController subclass,  that option should be left off to  
create a regular "UIView" Class..."

___

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: a bug in iphone SDK's creation of view based xib files.

2009-09-03 Thread jon


On Sep 3, 2009, at 6:37 AM, Roland King wrote:

 I didn't know the status bar was in there, either way that's not  
the way you do it


I realize after you just reminded me,  that i had said that wrong,   I  
did edit the plist file,  rather than the XIB file to disable the  
status bar.it would seem though, that setting the status bar to  
"none"  in IB should somehow make this change for you, so running it  
in the simulator,  you would get the expected behavior that is present  
in IB...   but I guess it just is not yet a perfect world.  I think  
version 7 of the SDK will become the perfect world :0)


Jon.
___

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


website like ebay.com's flash content crashing webKit like app?

2009-09-06 Thread jon

can someone else confirm this on 10.5,  and then 10.6 system..

if you create a simple cocoa Application  (not document based,  
although that will exhibit same problem)


then in Interface builder put in a webView,  and then a textfield into  
the Window of the simple application project,  use textfield as an  
address field for the webview.


include the Webkit framework in the project.

in IB,  hook the textfield to the Webview address bar field.

compile,   and type into the textfield of the running app:   "http://www.google.com/ 
" which works fine...


but if you change that to:   "http://www.ebay.com/";   then the  
application crashes after a few seconds of loading..


I believe that the flash content of ebay is crashing the app?can  
someone confirm?   is this a known bug?   something wrong with flash?   
my system?


Jon.
___

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: website like ebay.com's flash content crashing webKit like app?

2009-09-06 Thread jon
Are you saying that a version of this type of app is not crashing the  
Application  when you do this type of thing?   are you on snow  
leopard?  this simple app makes it through without exiting?  (using  
ebay.com?)


nothing too interesting about the console log,  here it is:   more  
like an abrupt exit...   nothing was spit out in the debugger as a  
crash.


-
[Session started at 2009-09-06 12:02:51 -0600.]
Debugger() was called!

The Debugger has exited due to signal 2 (SIGINT).The Debugger has  
exited due to signal 2 (SIGINT).

-

i have 10.5 and the latest version of Safari for leopard.   I am  
checking to see what version of flash this app would be running  
into... (not sure how to check that yet)


Jon.


On Sep 6, 2009, at 11:59 AM, Kyle Sluder wrote:


On Sep 6, 2009, at 10:38 AM, jon  wrote:

I believe that the flash content of ebay is crashing the app? 
can someone confirm?   is this a known bug?   something wrong with  
flash?  my system?


Have you enabled developer crash logs and checked the backtrace?  
Have you updated to the latest version of Flash and Safari?


--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: website like ebay.com's flash content crashing webKit like app?

2009-09-06 Thread jon
after installing flash again from Adobe,  to make sure it was the  
latest..(didn't help).   I realized that maybe the app needs to know  
about a "flash" type of framework or something like that?


is that type of thing needed?  possible?

Jon.


On Sep 6, 2009, at 11:59 AM, Kyle Sluder wrote:

Have you enabled developer crash logs and checked the backtrace?  
Have you updated to the latest version of Flash and Safari?


___

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: website like ebay.com's flash content crashing webKit like app?

2009-09-06 Thread jon


On Sep 6, 2009, at 1:11 PM, Jens Alfke wrote:

Run your app with 'breakpoints enabled', to make sure the gdb  
debugger loads. Then when it crashes you'll be in the debugger and  
can look at the stack and such. (Type "bt" into the gdb command area  
to get a textual bactkrace you can easily copy and paste into email.)




here is what it dumped out...

Jon.

[Session started at 2009-09-06 13:14:14 -0600.]
GNU gdb 6.3.50-20050815 (Apple version gdb-967) (Tue Jul 14 02:11:58  
UTC 2009)

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".sharedlibrary apply- 
load-rules all

Attaching to process 4216.
=shlibs-removed,shlib- 
info=[num="101",name="JavaPluginCocoa",kind="B",dyld- 
addr="0x16a0",reason="dyld",requested-state="E",state="E",path="/ 
System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Resources/ 
JavaPluginCocoa.bundle/Contents/MacOS/JavaPluginCocoa",description="/ 
System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Resources/ 
JavaPluginCocoa.bundle/Contents/MacOS/ 
JavaPluginCocoa",loaded_addr="0x16a0",slide="0x16a0",prefix=""]
=shlibs-removed,shlib- 
info=[num="102",name="JavaNativeFoundation",kind="F",dyld- 
addr="0x16a14000",reason="dyld",requested-state="Y",state="Y",path="/ 
System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/ 
JavaNativeFoundation.framework/Versions/A/ 
JavaNativeFoundation",description="/System/Library/Frameworks/ 
JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework/ 
Versions/A/ 
JavaNativeFoundation 
",loaded_addr="0x16a14000",slide="0x16a14000",prefix=""]

Debugger() was called!
(gdb) bt
#0  0x940cb402 in __pthread_kill ()
#1  0x940cb24f in pthread_kill ()
#2  0x93d59190 in Debugger ()
#3  0x17ad6e05 in dyld_stub_syslog ()
#4  0x17ad70bf in NP_Initialize ()
#5  0x95d365ef in -[WebNetscapePluginPackage _tryLoad] ()
#6  0x95d36217 in -[WebNetscapePluginPackage load] ()
#7  0x95d813cf in -[WebNetscapePluginDocumentView  
initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element 
:] ()

#8  0x95d6ecd9 in WebFrameLoaderClient::createPlugin ()
#9  0x90866554 in WebCore::FrameLoader::loadPlugin ()
#10 0x90866071 in WebCore::FrameLoader::requestObject ()
#11 0x907b46ca in WebCore::RenderPartObject::updateWidget ()
#12 0x907123b6 in WebCore::FrameView::updateWidgets ()
#13 0x90712081 in WebCore::FrameView::performPostLayoutTasks ()
#14 0x906f1eed in WebCore::FrameView::layout ()
#15 0x906f190b in WebCore::Timer::fired ()
#16 0x906d8bf2 in WebCore::ThreadTimers::fireTimers ()
#17 0x906d8612 in WebCore::ThreadTimers::sharedTimerFiredInternal ()
#18 0x906d8596 in WebCore::ThreadTimers::sharedTimerFired ()
#19 0x90d5dc64 in WebCore::timerFired ()
#20 0x900f48f5 in CFRunLoopRunSpecific ()
#21 0x900f4aa8 in CFRunLoopRunInMode ()
#22 0x916fa2ac in RunCurrentEventLoopInMode ()
#23 0x916fa0c5 in ReceiveNextEventCommon ()
#24 0x916f9f39 in BlockUntilNextEventMatchingListInMode ()
#25 0x954836d5 in _DPSNextEvent ()
#26 0x95482f88 in -[NSApplication  
nextEventMatchingMask:untilDate:inMode:dequeue:] ()

#27 0x9547bf9f in -[NSApplication run] ()
#28 0x954491d8 in NSApplicationMain ()
#29 0x1ffc in main (argc=1, argv=0xb730) at /Users/jonkai/ 
Desktop/junk2 11-43-39/main.m:14
(gdb) 
___


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: website like ebay.com's flash content crashing webKit like app?

2009-09-06 Thread jon

I just unchecked it,  now it runs through without the crash.

so there is something in flash that is checked that shouldn't be  
checked?or just sort of normal  and i always have to uncheck that  
when ever using the webkit?


Jon.



On Sep 6, 2009, at 1:22 PM, Jens Alfke wrote:

Flash is calling Debugger(), an old function for breaking into the  
debugger. It does this a lot, for some reason. Did you make sure to  
uncheck "Stop On Debugger()" in Xcode's Run menu?


—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: website like ebay.com's flash content crashing webKit like app?

2009-09-06 Thread jon
thanks for the replys,  that helped alot,   (now i've got to figure  
out why the sample code that comes with xcode "MiniBrowser"  does not  
load flash at all  (if garbage collection is turned on,  no other  
changes)...


it must be something related...   i've already tried unchecking for  
that project,   but it still doesn't load the flash content,
(miniBrowser also never stopped at a "break point" kind of thing  
either though)


but you've gotten me closer i think.

thanks,
Jon.


On Sep 6, 2009, at 1:39 PM, Jens Alfke wrote:

you'll hit lots of exceptions that the security/crypto code throws  
and then catches internally. This has annoyed me for a long time.)


___

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


myOutlineView rowForItem representedObject

2009-09-09 Thread jon
what is the opposite of the "representedOject" method  so that  
indexRow comes out correctly here below?




BaseNode* node4 = [[myOutlineView itemAtRow:i] representedObject];

indexRow = [myOutlineView rowForItem: [node4 ]];

___

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


Bug: CalendarStore framework adding events with alarms with email address.

2009-09-13 Thread jon
I will be making a bug report for this,  but this is here on the list  
to show that this can work,  if you ignore the result displayed in iCal.


If you have your address book filled out with your own card with your  
own email of for example "myem...@me.com",  not other emails in your  
card.


and then create a program with code like this that adds a calendar  
event in iCal like this with an alarm that has an email type of alarm  
event:


#import 
#import 
#import 

CalEvent *newEvent = [CalEvent event];
CalAlarm *alarm3 = [CalAlarm alarm];
NSError *err;
CalCalendar *AuctionAlarmCalendar = [CalCalendar calendar];

alarm3.action = CalAlarmActionEmail;
alarm3.emailAddress = @"mynewem...@me.com";
alarm3.relativeTrigger = -nuUnit3;
[newEvent addAlarm:alarm3];

	[[CalCalendarStore defaultCalendarStore] saveEvent:newEvent  
span:CalSpanThisEvent error:&err];



the iCal event will have a properly set up event with alarm,  but the  
email address will display "myem...@me.com".
the actual event alarm will correctly send an email to "mynewem...@me.com 
" though.  it will just have the wrong email displayed in the iCal  
event.. annoying, but atleast it will work.


Jon.



___

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


coding NSNumber in NSArray?

2009-09-14 Thread jon
I thought i had read that NSNumber knew how to code itself in an  
NSArray...  is this not the case? or is this code below just set up  
all wrong?  and what would the proper way be  to set this up?


bookMarkNode's coders are below,   this object has the one NSNumber,   
and two NSStrings


when i look in the debugger at "allItems",   the NSNumber is not well  
defined.


thanks in advance,
Jon.


BookMarkNode *node1 = [[BookMarkNode alloc] init];
[node1 setTypeOfLeaf:[NSNumber numberWithInt:0]];
[node1 setNodeTitle:@"eBay"];
[node1 setURL:@"http://www.ebay.com/";];

etc...

NSArray *allItems = [NSArray arrayWithObjects: node1, ..etc 
nil];

[node1 release];

//  
---

- (NSArray*)mutableKeys
{
NSArray *tempKeys = [NSArray arrayWithObjects:
@"typeOfLeaf",
@"nodeTitle",
@"urlString",
nil];

return tempKeys;
}
//  
---

- (id)initWithCoder:(NSCoder*)coder
{   
self = [self init];
NSEnumerator *keysToDecode = [[self mutableKeys] objectEnumerator];
NSString *key;
while (key = [keysToDecode nextObject])
[self setValue:[coder decodeObjectForKey:key] forKey:key];

return self;
}

//  
---

- (void)encodeWithCoder:(NSCoder*)coder
{   
NSEnumerator *keysToCode = [[self mutableKeys] objectEnumerator];
NSString *key;
while (key = [keysToCode nextObject])
[coder encodeObject:[self valueForKey:key] forKey:key];
}



___

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: coding NSNumber in NSArray?

2009-09-14 Thread jon
I put this code in to retain after you said that,  but there was no  
change in the outcome,  still the array shows everything in order,   
except that the NSNumber comes out as garbage.
I checked node1 to see if it was well defined,  before and after  
putting it into the array,  and it is.


Jon.

//  
---

- (void)setTypeOfLeaf:(NSNumber*)flag
{
if (!typeOfLeaf || ![typeOfLeaf isEqual:flag])
{
[typeOfLeaf release];
typeOfLeaf = [flag retain];
}
}



On Sep 14, 2009, at 10:21 AM, Randall Meadows wrote:


On Sep 14, 2009, at 10:11 AM, jon wrote:

I thought i had read that NSNumber knew how to code itself in an  
NSArray...  is this not the case? or is this code below just set up  
all wrong?  and what would the proper way be  to set this up?


bookMarkNode's coders are below,   this object has the one  
NSNumber,  and two NSStrings


when i look in the debugger at "allItems",   the NSNumber is not  
well defined.


thanks in advance,
Jon.


BookMarkNode *node1 = [[BookMarkNode alloc] init];
[node1 setTypeOfLeaf:[NSNumber numberWithInt:0]];


What does the code for -setTypeOfLeaf: look like?  If you're not  
retaining it in that method then it is getting (auto)released the  
next time the autorelease pool is drained.  Just because the array  
will automatically retain the node object doesn't mean the NSNumber  
inside that object will also be retained automatically.




___

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: coding NSNumber in NSArray?

2009-09-14 Thread Jon
I don't quite understand why you don't see the word "NSNumber" in my  
code...   when you said twice incorrectly that it doesn't involve an  
NSNumber


nor why you don't see the word "NSArray" in my code.  when you said  
again incorrectly you don't see an array being used?


Nor why you don't believe it is the "REAL" code?

nor why you want me to use encoding for an NSNumber?

it is pretty obvious other people understand what they are looking at.

maybe you ought to look and see if you can see where those words are  
used, and how they are used...




On Sep 14, 2009, at 1:02 PM, cocoa-dev-requ...@lists.apple.com wrote:


Anyway, I suspect the posted code wasn't the *real* code, and we still
don't know exactly what went wrong, or why the question is being asked
about a NSNumber that isn't (after all) in an array.


___

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: coding NSNumber in NSArray?

2009-09-14 Thread jon

here is what is in typeOfLeaf.

Jon.

//  
---

- (NSNumber*)typeOfLeaf
{
return typeOfLeaf;
}

On Sep 14, 2009, at 2:21 PM, Kyle Sluder wrote:

But we still need to see -typeOfLeaf to make sure it's doing the  
right thing.


___

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


getting accessor method info in a different class.

2009-09-18 Thread jon
In one class,  I have set webView up like this...  which works fine,   
but i want to have access to this pointer from another class...
i am not getting something correct here,  it gives me warning:   
"WebView may not respond to webView"

i'll just include the relevant code.

what am i not understanding about accessor methods?
what is the proper way to have access to the pointer of the webView  
but in a different class..


 the webviewcontroller class works as it should, (the .m file has the  
@synthesize in it)  but the bookmarkcontroller class returns the  
warning above. (some extra stuff is added like @class to see if it  
would help)

Jon.

header of class webviewcontroller:
-
#import 
#import 

@interface webViewController : NSDocument
{
IBOutlet WebView *webView;
}

@property(readwrite,retain) WebView *webView;

@end
-

header of class BookMarkController:
-
#import 
#import 
#import "webViewController.h"

@class WebView;

@interface BookMarkController : NSWindowController
{
WebView *theWebView;
}

@end
-

implementation of class BookMarkController:
-
#import "BookMarkController.h"

@implementation BookMarkController

- (void)setup
{
[theWebView webView];  // here i get the warning;
}

@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


access to object from a different class

2009-09-18 Thread jon
Ok,  I did not get the desired result, but i am a little closer,  I'm  
going to set this up again.
below is example code to set up the circumstance,  so you better see  
what i want to do. (stripped down to what i am trying to find out)   
(webView is hooked up in IB to a WebView object)


 (i want to replace the  with something that would work where  
theWebView is pointing to the same thing as "webView" from the first  
class a pointer to the current WebView object)


In first class,  I have set webView up like this...  which works  
fine,  but i want to have access to this current webView object from a  
different class


how does one go about getting at the instance "webView" coding wize???

Jon.

header of class WebViewController:
-
#import 
#import 

@interface WebViewController : NSDocument
{
IBOutlet WebView *webView;
}

@property(readwrite,retain) WebView *webView;

@end
-

implementation of class WebViewController:
-
#import "WebViewController.h"

@implementation WebViewController

@synthesize webView;

@end
-

header of class BookMarkController:
-
#import 
#import 
#import "WebViewController.h"

@class WebView;

@interface BookMarkController : NSWindowController
{
WebViewController *aController;
WebView *theWebView;
}

@end
-

implementation of class BookMarkController:
-
#import "BookMarkController.h"

@implementation BookMarkController

- (void)setup
{
	theWebView = ?  (i want to point to the same thing as webView's  
pointer to it's instance)  or basically>  theWebView = webView;

}

@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: access to object from a different class

2009-09-18 Thread jon

Added info:

i would try this:   theWebView = [aController webView];except that  
the "aController" is new, and not pointing to the thing i want,  the  
first webView's pointer to it's object instance...


Jon.
___

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


Preferencepanel.xib file with an extra delegate object place inside

2009-09-21 Thread jon
I've created a preference panel controller object and xib file which  
are normal,  except for the fact that i've also placed an extra object  
in the xib file.


the sole purpose of this extra custom controller object  (sole  
purpose of it being in this xib, it has a whole other life in it's own  
xib)///  is so that i can make this custom object the delegate of the  
PreferencePanelController by a single connectiong in IB
from the preference  panel controller delegate to this extra custom  
controller object,  (which i need to access one of it's methods)


the problem is that this custom controller object has an awakeFromNib  
method,for it's own window object.


so everytime i call the preference panel,  the awakeFromNib in the  
custom controller object is fired


hopefully some well heeled cocoa sailer captain here is going to tell  
me there is a way around this situation (other than "don't do that")   
where you'd think the engineers have thought about how you would go  
about connecting up delegates and just plain old methods   (like main  
menu submenu Preference,   being connected to a different file  
(different object  in that file) (the preference panel controller  
object)


hopefully i can create these "extra objects in Xib files"  all i want,  
and be-able to get around this action,  because I constantly need to  
fire off other panels and windows from say the

main menu,  or preference panel   is there a way??

thanks in advance,
Jon.
___

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


automatically send the email from code using NSWorkspace

2009-09-22 Thread jon

I've set up some code to send an email from my app like so:

[[NSWorkspace sharedWorkspace] openURL: [NSURL  
URLWithString:eMailString]];


it works fine,  but I want to go ahead and have it automatically send  
the email, rather than display the email on screen (ready to send)...


Can someone point me in the correct direction?

thanks in advance
Jon.

___

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: automatically send the email from code using NSWorkspace

2009-09-22 Thread jon
great,  found it,  Thank you.  do you (or someone) know how to get  
the current machine's default Email address for sending email?


rather than typing it into a field like this.

emailMessage.sender = [self.fromField stringValue];

thanks again,
Jon.

On Sep 22, 2009, at 8:35 PM, Nick Zitzmann wrote:



On Sep 22, 2009, at 8:16 PM, jon wrote:

it works fine,  but I want to go ahead and have it automatically  
send the email, rather than display the email on screen (ready to  
send)...


Can someone point me in the correct direction?


Use NSAppleScript or the scripting bridge. There's some sample code  
on ADC that will show you how to use the scripting bridge to send a  
message.


Nick Zitzmann
<http://www.chronosnet.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


redrawing a particular subview in non mainWindows.

2009-09-27 Thread jon

I've got a Document type program,

the windows are structured like this:

Window -> ContentView -> SplitView -> two CustomViews -> one of them  
is Bordered Scroll view (outlineView) ->Outline View


i have one instance of Outline View  called myOutlineView,   so no  
matter how many documents are displayed on the screen,   there is only  
one myOutlineView instance,


the current "mainWindow"  updates the myOutlineView just fine when i  
make a change to this one instance,   but i want to "redraw" or update  
the Outline View of all the other open documents that can be seen so  
they also match (on screen) the one instance of myOutlineView.   in  
code they already do match.  so they just need "updated".


so far i can find the chain of windows,  like this,  but i can't  
figure out how to go deeper into them to be able to udpate the custom  
view down deep   maybe i'm approaching it wrong too...


any help would be great,(the setHidden is just there as a test,   
it is there so i know i've found the correct window, and eventually  
the correct subview)

thanks,
Jon.

IBOutlet NSOutlineView  *myOutlineView;
--


NSArray *theWindowsArray = [NSApp orderedWindows];
NSWindow *theWindow = [theWindowsArray objectAtIndex:1];

theContentView = [theWindow contentView];

//-  i need to find the split view of "theContentView"  and  
then the outline view of that one side of the split view -//


[theContentView setHidden:YES];



___

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: redrawing a particular subview in non mainWindows.

2009-09-27 Thread jon
I am probably not describing it accurately,I'll try to understand  
and describe what is going on more accurately in a bit,   more likely,  
i have one set of data,   and each time a new window is open,  it is  
creating another instance of the outline view,   i have not found away  
to get at the old instances of this view...


thanks,
Jon.


On Sep 27, 2009, at 8:31 AM, Graham Cox wrote:


 so I'm skeptical that your description is really accurate.


___

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: redrawing a particular subview in non mainWindows.

2009-09-27 Thread jon
ok,  after thinking and analyzing what was going on,  everytime i make  
a new document in the running app,   it created a new instance of the  
window and all related stuff in the window including myOutlineView.   
and then my dataSource in code remained the same that fills out these  
outline views...   (atleast this is my current understanding).


so my question now morphs into:

  as Jens says below,  he in some cases is looping through the apps  
window list...


in my case,   in my main document xib,  i have an "outline Controller"  
which is type NStreeController...  and i have this defined..


IBOutlet NSTreeController *treeController  which is the thing that is  
controlling the outline view,  and appears to be the thing i want to  
update...


the question it appears to me is:  that this "treeController" also is  
made into multiple instances with each new Document,   is there an  
already defined "loop" of these?  (a list of the open document's  
NSTreeController *treeController;)


or do i need to make an NSMutableArray,  and keep track of these  
myself?   and then update these instances myself by looping through  
them?


thanks,
Jon.

On Sep 27, 2009, at 9:54 AM, Jens Alfke wrote:


 The way I do this is to loop through the application's window list,


___

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


NSTextField, drawing the text offset to the right in the field

2009-09-28 Thread jon

i've got a textfield defined...

IBOutlet NSTextField *addressBar;

but i don't want to draw the text that is in the field right up  
against the left boarder of the bounding box of this defined field in  
IB,


I want to start the text like 20 pixels to the right of the left  
boarder  and still have the nicely defined frame of the field in it's  
original place...


so far i've tried various methods,   one of them is below

NSRect newFrame = [addressBar bounds];

newFrame.size.width -= 20;
newFrame.origin.x += 20;
[addressBar displayRect:newFrame];

but haven't had any success,  I'm sure someone here knows exactly what  
i'm trying to do and knows a quick way to do it..


i've also tried this:  thinking i could get a textview back into a  
textfield...  or somehow use a textcontainer on NSTextField... with no  
success...


[addressBar setTextContainerInset:theInset];


thanks,
Jon.


___

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: NSTextField, drawing the text offset to the right in the field

2009-09-29 Thread jon

i've got something i think is close...

i've got a custom cell,  and a custom textfield,

i've got an override implementation of "drawInteriorWithFrame"  that i  
think will work.


but i'm confused as to where to call "drawInteriorWithFrame",   right  
now it is inside the custom Cell,   but the custom textfield never  
calls it as i believe it should?


right now
---
IBOutlet ImageTextField *addressBar;
---

[addressBar setStringValue:urlString];
is properly using my custom textfield,  but the custom textfield  
doesn't appear to be using the custom cell...  (or atleast the new  
drawInteriorWithFrame is not being called)


(i have not overriden the "setStringValue")  Maybe this isn't the  
right call, and it is bypassing "drawInteriorWithFrame"?


the only connection between custom textfield and the custom cell is

#import "ImageTextFieldCell.h"

 is inside the header of the custom textfield.

does there need to more connection to it?   or how would i get this  
call to the new drawInteriorWithFrame?


the running app shows the text field filled in properly (just not  
offset, as the override implementation of drawInteriorWithFrame would  
have done) ,   so it must have called the super of it somewhere.


thanks for the help in advance.
Jon.




On Sep 28, 2009, at 9:30 PM, Matt Neuburg wrote:


On Mon, 28 Sep 2009 19:37:00 -0600, jon  said:

i've got a textfield defined...
but i don't want to draw the text that is in the field right up
against the left boarder of the bounding box of this defined field in
IB,

I want to start the text like 20 pixels to the right of the left
boarder  and still have the nicely defined frame of the field in it's
original place...


What I do is have the textfield replace its cell by a custom cell that
implements drawInteriorWithFrame, such as to inset its frame rect as  
it

calls super. m.

--
matt neuburg, phd = m...@tidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings





___

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


simpleBrowser example has setCellClass setting a cell to an instance?

2009-09-29 Thread jon

how is the simpleBrowser example that is provided with xcode doing this?

[fsBrowser setCellClass: [FSBrowserCell class]];

fsBrowser is an instance,

IBOutlet NSBrowser*fsBrowser;

yet isn't setCellClass a class method?

i tried the same thing and got a warning?

thanks,
Jon.


___

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: simpleBrowser example has setCellClass setting a cell to an instance?

2009-09-29 Thread jon
oh,  i was thinking that method was inherited from the NSControl  
class...


great,  so now i still can't figure out why my custom Cell methods are  
not firing  still looking for the problem..


Jon.


On Sep 29, 2009, at 6:28 PM, Jens Alfke wrote:



On Sep 29, 2009, at 5:19 PM, jon wrote:


  [fsBrowser setCellClass: [FSBrowserCell class]];

fsBrowser is an instance,

  IBOutlet NSBrowser*fsBrowser;

yet isn't setCellClass a class method?


No, it's a regular instance method; just look in NSBrowser.h:

- (void)setCellClass:(Class)factoryId;

—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: NSTextField, drawing the text offset to the right in the field

2009-09-29 Thread jon

hmmm,  well i'm trying hard to do it...here is what i've done...

in a header:

IBOutlet ImageTextField *addressBar;

i've created this pointer to this instance...

and then in the awakefromNib method,  i have this...

[ImageTextField setCellClass:[ImageTextFieldCell class]];

this set's the class so it's cell is "correct"... for the class...   
but


but maybe this is too late for the instance addressBar.  which was set  
in the header and IB???


I don't know how to check this instance to see if it is using the  
custom cell,   and i don't know how to set the instance  
specifically... (if this class method didn't do it)?


Jon.







On Sep 29, 2009, at 7:06 PM, Matt Neuburg wrote:


On or about 9/29/09 4:43 PM, thus spake "jon" :

is properly using my custom textfield,  but the custom textfield  
doesn't

appear to be using the custom cell


Then you have to *make* the custom textfield use the custom cell. :)  
Use
whips and chains if necessary. Actually, I think what I said before  
may

cover this sufficiently:


On Sep 28, 2009, at 9:30 PM, Matt Neuburg wrote:
What I do is have the textfield replace its cell by a custom cell  
that
implements drawInteriorWithFrame, such as to inset its frame rect  
as it

calls super. m.


As the first part states, an instance of your cell class must *be*  
this text

field instance's cell. You have to make that happen... m.

--
matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
http://www.tidbits.com/matt/default.html#applescriptthings
Take Control of Exploring & Customizing Snow Leopard
http://tinyurl.com/kufyy8
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.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: NSTextField, drawing the text offset to the right in the field

2009-09-29 Thread jon
ahh,  that was it,   thanks a lot,   that made perfect sense once i  
looked inside IB

I was also surprised that IB knew about my custom cell class...

I was thinking code code code...   and i just needed that shove in the  
correct direction...

you made my day,  after a very long day...

thanks,
Jon.


On Sep 29, 2009, at 7:58 PM, Kyle Sluder wrote:


+setCellClass: just tells the view "Hey next time you initialize
yourself, make a cell of this class."  Since your ImageTextField
instance was created inside of IB, this is never going to happen.
Instead you need to change the class of the cell from within IB, under
the Identity inspector.  It might be helpful to switch to the
hierarchical view so you can get easy access to the text field's cell.


___

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


IB webview oddity/question...

2009-10-01 Thread jon
if you make a new IB project,   create two new windows,   with a new  
webview located into each window,


if you go to one of the webviews,  and get the inspector up and go  
into the attributes,  and turn off everything,  like java,  plugins,  
animate images,  etc...


the second webview also turns all of it's attributes too?   if you  
turn one of them on,  they both turn on.


why are they linked?

Jon.
___

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


possible bug in webView big and small load sizes...

2009-10-01 Thread jon
I did an experiment,  where i had a small window with a small webView  
in it...


and then a large window with a large webView in it,  in the same XIB  
file...   small was like 200 pxs   and the large one was nearly as  
large as the screen.


(actually i had the same window,  and ran a loop,  while the program  
was executing, i would simply drag the window to small, and then large  
size,  randomly and controled one execution of the loop per drag of  
the window,  to make sure,  i would do several smalls in a row,  and  
then several large in a row...  and then alternated for a while...)  i  
also have a timer to delay at my setting,  so that i am sure the page  
is completely loaded...


i loaded a complex search result  of Ebay.com web site into the  
webView,   Ebay has a lot of flash and Java, and lots of real Cr*P on  
in their search pages..  (this will only fail with an Ebay site or  
a site with lots of kludge,  not other sites)


after i load each view,   I  ask it for it's   DOM document


	DOMDocument *myDOMDocument = [[offScreeneBayWebView mainFrame]  
DOMDocument];


very consistently later in the class,  the small window ALWAYS fails  
to have a viable DOMDocument or atleast partially non viable..


while the large webView consistently always gives me all of the data

I'm wondering if this is a bug,  and if anyone has seen something like  
this before?



here is the code that consistently fails on the small window,  the  
"attValue"  consistently is "nil" in the small window,  and always  
correctly sets in the large window...
on exactly the same page load.. which is a very complicated search on  
a specific category of ebay.com


this looks like a bug to me...   but maybe someone knows what is going  
on here..


interestingly,  "thelength1"  is always correct,  on both the small  
and big windows...  i can't find any memory reason why this would fail  
on small and then fly on a big window... (looking for a memory problem  
in my program)...


Jon.


	DOMDocument *myDOMDocument = [[offScreeneBayWebView mainFrame]  
DOMDocument];
	DOMNodeList *allTableNodes = [myDOMDocument  
getElementsByTagName:@"table"];

NSUInteger thelength1 = [allTableNodes length];

DOMNode *node;
DOMNode *att;
NSString *attValue;
DOMNamedNodeMap *attributes;

for (i = 0; i < thelength1; ++i)
{
node = [allTableNodes item:i];
attributes = [node attributes];

att = [attributes item:0];
attValue = [att nodeValue];
if(attValue != nil)
{
isItInThere = [attValue rangeOfString:@"nol"];

			if (isItInThere.location != NSNotFound)   //-- this bothers  
me,  what is the non negative way of asking this if statement?

if (![attValue isEqualToString: @"cmpb nol"])  
{break;}
}
}


___

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: possible bug in webView big and small load sizes...

2009-10-02 Thread jon
that sounds plausible,  there are more than one attributes...   I  
don't know the name of the element,  just that part of the name is  
"nol"  and that i don't want the one called "cmpb nol"...


which makes it difficult,   but you gave me something i can experiment  
with  to see if i can see that behavior happen,   thanks.


Jon.



On Oct 2, 2009, at 12:17 AM, Stephen J. Butler wrote:


Does your table element have multiple attributes? The DOM Level 2
specification states that for NamedNodeMap there is no specified order
to the attributes. It could just be coincidence that the larger window
puts attributes in one order, and the smaller in another. If you know
the name of your attribute, why not just call:

attr = [attributes getNamedItem:@"someName"];


___

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


adding a new window and controller to a Document project on startup...

2009-10-02 Thread Jon
On a standard Cocoa Document based project,   I want to add a new  
window object/instance on startup (similar to adding a preference  
panel, but a permanent offscreen window)


as an experiment,  i did this below with a new onScreen window:

i get the new window to load alright on start up,  but this disables  
the old Document class somehow?,  not even the old init is called  
anymore??...  I'm sure someone here can see quickly what i'm missing  
in this experiment process...

(or give me a quick lesson in how Cocoa document apps startup)


start with a new Document based cocoa project..

add this new window controller class,  also add a xib file that is  
nothing more than another window the same as the MyDocument.xib  
connect the new window to this new owner object



#import 

@interface MyDocument2 : NSWindowController
{
}
@end


#import "MyDocument2.h"

@implementation MyDocument2

- (id)init
{
self = [super initWithWindowNibName:@"MyDocument2"];
if (!self) { return nil;  }
[self showWindow:nil];
return self;
}

- (NSString *)windowNibName
{
return @"MyDocument2";
}

@end


in the main menu nib,  added a new "object" and make it the  
"MyDocument2" object.  so that this class loads on startup, and i get  
the window on startup.


in the old "MyDocument" class,  i changed this as an experiment, maybe  
this is closer.


#import 
#import "MyDocumentController.h"

@interface MyDocument : NSDocument
{
}
@end


/*- (NSString *)windowNibName
{
return @"MyDocument";
}*/

- (void)makeWindowControllers
{
	MyDocumentController *controller = [[MyDocumentController alloc]  
initWithWindowNibName:@"MyDocument"];

[self addWindowController:controller];
	[controller showWindow:nil];   //  trying different  
things in here..

}


and then I added this class as part of the experimenting...


#import 

@interface MyDocumentController : NSWindowController
{
}

@end

#import "MyDocumentController.h"

@implementation MyDocumentController

- (id)init
{
self = [super initWithWindowNibName:@"MyDocument"];
if (!self) { return nil;  }
[self showWindow:nil];
return self;
}

- (NSString *)windowNibName
{
return @"MyDocument";
}

@end


 nothing from the original document class is being executed anymore?
this project loads the "MyDocument2" object window correctly,   but  
then doesn't load the actual MyDocument object or it's window.


thanks for any help in advance on letting me know the fundamental  
thing i'm missing in how Cocoa document based apps start up..

Jon.
___

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


main nib, firing a secondary nib and it's controller....

2009-10-03 Thread jon
i want to have a WindowController object and it's own nib separate  
from the main nib..


but i want this secondary nib and controller to fire up when the  
application launches...


what is the best way to do that?

thanks in advance,
Jon.
___

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: main nib, firing a secondary nib and it's controller....

2009-10-04 Thread jon
thanks,  as a follow up,   is this the proper way to create and open  
the instance? (also globally, so it can be used in other parts of the  
app?)
can this be improved on?  (starting up a window Controller object and  
it's xib file)


thanks for the suggestion.
-Jon.

I also need to deallocated the instance on closing of the window...

---
#import 
#import "WebViewController.h"

@interface AppDelegate : NSObject
{
}

@end
---
#import "AppDelegate.h"

static WebViewController *webViewController = nil;

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
	webViewController = [[WebViewController alloc]  
initWithWindowNibName:@"WebViewController"];

}

@end




On Oct 3, 2009, at 10:21 PM, Jens Alfke wrote:



On Oct 3, 2009, at 4:19 PM, jon wrote:

i want to have a WindowController object and it's own nib separate  
from the main nib..
but i want this secondary nib and controller to fire up when the  
application launches...


Create and open an instance of that WindowController subclass from  
your app delegate's -applicationDidFinishLaunching: method.


—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


wait for the event?

2009-10-05 Thread jon
i have a webView loading,   and need to wait until it is finished  
loading...


so far i've set up this notification in the wakeFromNib:

NSNotificationCenter *center = [NSNotificationCenter  
defaultCenter];
[center addObserver:self  
selector:@selector(webViewProgressFinished:)   
name:WebViewProgressFinishedNotification object:offScreenWebView];


and then i have a selector/method like so,  with nothing in it,   
because i'm not sure what to put in it yet...


- (void)webViewProgressFinished:(NSNotification*)notification
{
NSInteger i = 1;
}

and then i have a the main method that is running along,  and at a  
certain point below i need to wait for that notification to fire... Or  
that method to fire... same thing...
i need a little push in the correct direction,  because i really am  
stumped in whether to use some sort of NSRunLoop, or NSEvent,  or what  
would it be?


URLToLoad = [NSURL URLWithString:theUrlString];
[offScreenWebView setFrameLoadDelegate:self];
   	 [[offScreenWebView mainFrame] loadRequest:[NSURLRequest  
requestWithURL:URLToLoad]];


[[NSRunLoop currentRunLoop] runUntil... we get that darn message?];

here is where i need to wait until i get that message, or that that  
method is fired...
I seem to have the selector firing correctly i believe ...   but i  
don't know how to wait until it fires?

that is what i have so far...
and help would be appreciated greatly...

thanks,
Jon.


___

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: wait for the event?

2009-10-05 Thread jon
I had a bunch of arguments in the method and a returning boolean  
value,   which hampered the effort...  I'm in the process of making  
them variables in the class,  so i can get it down to a void method  
with no arguments,  and am putting the rest of the method into the  
selector as you suggested...


now i've got a new problem,   i have two methods that are similar,  
that run for different webpages,  but use the same offscreen  
webView,   so i need to have the notification select two different  
method/selectors (or one with a flag)  (because the code that ends up  
in them is vastly different)..  so i'm going to have to have yet  
another flag that says, "go off and do two different things" at the  
selector method  i'm trying to figure that out now too.  If anyone  
has a suggestion on that,  that would be great too...


sorry for terminology,  i'm still trying to wrap my brain around what  
to call things (how they work)...


interestingly,  i tried to put the


URLToLoad = [NSURL URLWithString:theUrlString];
[offScreenWebView setFrameLoadDelegate:self];
 	 [[offScreenWebView mainFrame] loadRequest:[NSURLRequest  
requestWithURL:URLToLoad]];


code into a secondary thread,   and let it run,  then had the thing  
exit to the main thread when it was done,  or so i thought,  but it  
appears to load
 it into it's own thread,  because the way i had it set up,  it  
immediately exited the secondary thread,  and then the notification  
fired sometime later


 i'm reverting to doing it in the main thread as you suggested...

here is what i was using as an example,   which does not work in the  
case of loading a webView for anyone thinking of doing it.  (or  
atleast i couldn't get it to work)

(last comment has the code example that i followed...)
Best way to make NSRunLoop wait for a flag to be set? - Stack Overflow


thanks,
jon.


On Oct 5, 2009, at 3:46 PM, Matthew Mashyna wrote:

Is there a reason you have to loop and wait for it to finish instead  
of doing more work in the notification method


___

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: wait for the event?

2009-10-05 Thread jon

well there seems to be a problem,   I do the main Method like so,

- (void)loadThePage
{
URLToLoad = [NSURL URLWithString:theUrlString];
[offScreenWebView setFrameLoadDelegate:self];
	[[offScreenWebView mainFrame] loadRequest:[NSURLRequest  
requestWithURL:URLToLoad]];

}

@end

and i put the rest in the selector method like so...  to be executed  
when the page is fully loaded,  which works...  but the thing is,  the  
code immediately following the main call to "loadThePage" isn't  
waiting, it keeps on executing... which defeats the purpose,  the  
whole program needs that data.


//  
---

- (void) webViewProgressFinished:(NSNotification*)notification
{
didChange = NO;
	DOMDocument *myDOMDocument = [[offScreenWebView mainFrame]  
DOMDocument];

... etc

 if the webpage was quick to load it works   in reality the page  
takes a while to load,  and in the mean time,  the rest of my  
application  (the code after the "loadThePage" keeps on executing so i  
have not successfully controlled the running of the app.,  it is  
executing methods left and right,  without the finishLoadingTheWebPage  
ever being called until half the application has already executed...


putting the loading into another thread results in the same thing,
the rest of the application needs the data,  so it can not be running  
until the webPage is fully loaded...


so i have to use a combination,  i need to put in a flagging type of  
thing, and have the runLoop wait for that flag,  the flag needs to be  
in the "webViewProgressFinished"  to work (it was not before)..  yet i  
still need that flag



thanks,
Jon.



On Oct 5, 2009, at 3:46 PM, Matthew Mashyna wrote:



On Oct 5, 2009, at 12:51 PM, jon wrote:

i have a webView loading,   and need to wait until it is finished  
loading...


so far i've set up this notification in the wakeFromNib:

  NSNotificationCenter *center = [NSNotificationCenter  
defaultCenter];
  [center addObserver:self  
selector:@selector(webViewProgressFinished:)   
name:WebViewProgressFinishedNotification object:offScreenWebView];


and then i have a selector/method like so,  with nothing in it,   
because i'm not sure what to put in it yet...


- (void)webViewProgressFinished:(NSNotification*)notification
{
NSInteger i = 1;
}

and then i have a the main method that is running along,  and at a  
certain point below i need to wait for that notification to fire...  
Or that method to fire... same thing...
i need a little push in the correct direction,  because i really am  
stumped in whether to use some sort of NSRunLoop, or NSEvent,  or  
what would it be?


URLToLoad = [NSURL URLWithString:theUrlString];
[offScreenWebView setFrameLoadDelegate:self];
 	 [[offScreenWebView mainFrame] loadRequest:[NSURLRequest  
requestWithURL:URLToLoad]];


[[NSRunLoop currentRunLoop] runUntil... we get that darn message?];

here is where i need to wait until i get that message, or that that  
method is fired...
I seem to have the selector firing correctly i believe ...   but i  
don't know how to wait until it fires?

that is what i have so far...
and help would be appreciated greatly...

thanks,
Jon.




In general you don't want to wait for, uh what did you say? a  
selector to fire? You start an asynchronous operation (like  
loadRequest) and let the current run loop notify you. Exit the  
method after you do your loadRequest. When you get the notification,  
do your thing to finish it in webViewProgressFinished -- do the  
thing that you were waiting to do.


I could be wrong but I think you might actually be blocking the  
notification by doing the sit 'n spin bit with [[NSRunLoop  
currentRunLoop] runUntil... we get that darn message?];


Is there a reason you have to loop and wait for it to finish instead  
of doing more work in the notification method? If there is then  
maybe you should use a lock to synchronize the threads instead of  
waiting.


You might want to tell us more about what you're trying to do.


Matt


___

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: wait for the event?

2009-10-05 Thread jon
oh you've got that right,  I unfortunately have it ingrained for 25  
years of straight pascal in MacOS...  i could destroy a runloop with  
the best of them...


I wish i started cocoa 7 years ago, but it was not to be.  My  
brain is trying to refactor,  and it is fighting mightily... trying to  
keep up with the young-uns who have no such baggage...


I'll look into NSLock thanks,
Jon.

On Oct 5, 2009, at 7:45 PM, Matthew Mashyna wrote:

you need some time to come around to a different way of thinking.  
You are thinking too linearly.


___

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


real verses Virtual memory

2009-10-10 Thread jon

I have an app that run's a process every 20 seconds during the day...

is there a way to force it to use real memory rather than virtual?

because it runs every 20 seconds,  and is defaulting to normal memory  
allocation,


it has a lot of disk swapping in and out,  many many times during the  
day,  and it seems like this
 would negatively effect the life of a disk and performance of the  
whole machine?


Jon.
___

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: real verses Virtual memory

2009-10-10 Thread jon
it loads a website,  to see if there are changes to the website,  it  
then does a lot of work,   the large memory things,  like the  
"webView"  are just one instance, and are not deallocating... (uses  
just that one instance over and over again,  not making new ones)   so  
that i don't think is the problem...  (or maybe even if the instance  
is allocated just once,  does reloading a webView do any thing that  
makes it write to memory?)


and then all the little stuff  of allocating for a small variable, is  
adding up each time,   i really don't want to make every variable  
global...  but if that is proper technique,  then i'll do that...


are we saying there is no way to make a process use real memory?
Jon.

On Oct 10, 2009, at 9:04 AM, Michael Dautermann wrote:

You'd probably get a much more thorough & better answer from the  
list if you elaborated on what the ultimate goal of that repeating  
process is.


___

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: real verses Virtual memory

2009-10-10 Thread jon
exactly,   I look at Activity monitor,  "disk Activity"   and i can  
see a spike of disk data read/writes every 20 seconds.

Jon.

On Oct 10, 2009, at 9:31 AM, Jean-Daniel Dupas wrote:

What is real memory ? Do you want to address the RAM directly  
without any virtual to physical mapping ?


___

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: real verses Virtual memory

2009-10-10 Thread jon
no,  no control over the website,   but on webView i turned off all  
the java script and flash and stuff,  so that helps with the speed,   
not with it using virtual memory every 20 seconds,  and it does need  
to be 20 seconds.

Jon.

On Oct 10, 2009, at 9:44 AM, Michael Dautermann wrote:

Is this a website that you have control over?  Where if anything  
changes


___

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: real verses Virtual memory

2009-10-10 Thread jon
Ok, let me re-word it then,  is there a way i can keep a process from  
using Disk writes as a form of it's own memory use?   I already  
know that it is a memory "thing"  since the program never uses the  
disk to write out any files. (during the process)...  nor use the disk  
in any other way,  except for the memory being "virtual".


there are no files being accessed,  only the webView  that is it's  
source of data  it's only source.  it works on that data,
finishes,   and does nothing for 20 more seconds.   (a trigger can  
happen,  but even if there was no trigger,   the disk writes are there)


Jon.

On Oct 10, 2009, at 10:08 AM, Shawn Erickson wrote:


This is, as stated, nonsensical.


___

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: real verses Virtual memory

2009-10-10 Thread jon
ok thanks, i was pretty sure it is "normal behavior"  i am only  
asking if there is away around that particular behavior, and your  
answer was what i figured might be the case...


so i am a little clearer,   it is normal for apps to use disk IO in  
the way we are describing,  even if there is no real memory pressure,   
correct?  (a form of it's virtualization?)


I am looking at "cacheing" right now to see if there could be anything  
better done in that area. in IB , i disabled everything for the  
webView  (java, java script, ect...)


the program is not relaunching every 20 secs,  it is reloading a  
webView every 20 secs.   and then doing a bunch of work on that  
data,   there is no real calls to anything API except of course the  
webView reload itself,  which i assume is what is causing normal  
memory use,  it definitely is causing a CPU use spike, and there is no  
user interface to update,  except again, for the webView object  
instance,  and it is hidden...there is   only number crunching  
after the webview load... including using memory to store  
variables...


i never thought there was anything wrong,   only maybe a way to keep  
the process from using disk swaps as it's source of memory.


Jon.


On Oct 10, 2009, at 11:03 AM, Bill Bumgarner wrote:

In other words: No, there isn't a way for your app to use "real  
memory".  Or, to rephrase


___

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: real verses Virtual memory

2009-10-10 Thread jon
I could use an explanation then,   if you go into "activity monitor"
you will see a heading of "real memory"  and "virtual memory".   
specifically for all the current "Processes"..


what does Apple mean by "real memory"?in that,  I might see why  
you asked the question?and why you think that i am using it  
incorrectly for my particular "process"...  i can see Apple label my  
process as using "real memory"?  and "virtual memory"  what does apple  
mean?


Jon.

On Oct 10, 2009, at 9:31 AM, Jean-Daniel Dupas wrote:


What is real memory ?


___

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: real verses Virtual memory

2009-10-10 Thread jon
oh yes,  i plan on optimization,  but this was not the original  
question,  not one of how should i optimize,  it was one of "can i  
keep my process from using Disk I0,  as a means of it's memory  
use?".   to save on wear and tear of the disk for this particular  
process.


On Oct 10, 2009, at 11:49 AM, Shawn Erickson wrote:


Jon, please use Instruments.app


___

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: real verses Virtual memory

2009-10-10 Thread jon
Hi Bill,  in this theme of normal behavior,  maybe this would make  
what i'm asking more clear.


in an exercise of thought,  if you wrote an app,  and the only thing  
it did was  put up a window permanently (for the run of it's process  
life),  with a single webview in it,  and hardwired a load of any  
particular website you wished that had any substance to load in that  
webview...   and then put in a trigger to simply reload that same  
website every 20 seconds...   and that was it,  no number crunching,   
or extra processes, or UI.


if you had to guess,  if you looked in activity monitor,   do you  
think this thought experiment would use disk IO every 20 seconds?


thanks,
Jon.


On Oct 10, 2009, at 11:03 AM, Bill Bumgarner wrote:

2) if there is a persistent cache -- a web cache, perhaps? -- it may  
be updated, causing I/O


___

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: real verses Virtual memory

2009-10-10 Thread jon
ok,  I have Activity monitor open,  particularly to the "disk  
activity" tab,  and the IO checked, as i said before,  and i can see   
Disk writes every 20 secs.is there a clearer way to demonstrate  
that Disk IO is happening?  am i fulling my self by looking at this  
tool?


Jon.

On Oct 10, 2009, at 12:07 PM, Shawn Erickson wrote:

Again it isn't clear if swapping is what is actually happing based  
on what you have so far posted to this list.


___

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: real verses Virtual memory

2009-10-10 Thread jon

ahh,  ok  thanks,  that helps a lot.
Jon.

On Oct 10, 2009, at 12:30 PM, Alex Kac wrote:


If it was using a web cache, then yes.


___

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: real verses Virtual memory

2009-10-10 Thread jon
thanks for doing that,   it helped,  cacheing hmmm...   i don't think  
there is away around this,   i need a fresh load to see if the data  
has changed each time at the website.It appears that disk IO is  
here to stay.


Jon.



On Oct 10, 2009, at 12:57 PM, Shawn Erickson wrote:

Which is exactly what I expected (and others) given the fact that by  
default the URL loading sub-system used on Mac OS X will attempt to  
cache remote resources.


___

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: real verses Virtual memory

2009-10-10 Thread jon
oh wait,  that means i can turn off cacheing,   I at least can see if  
that will help,   I'll go read up on how to turn off cacheing..

Jon.

On Oct 10, 2009, at 12:57 PM, Shawn Erickson wrote:

Which is exactly what I expected (and others) given the fact that by  
default the URL loading sub-system used on Mac OS X will attempt to  
cache remote resources.


___

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: real verses Virtual memory

2009-10-10 Thread jon
I take the info off the website,  "data" if you like...   data that  
changes or could change at any given time,  every second even
and process it,  and trigger an event if the data is to my liking.


how would i get the data off a website,   formated in the only way i  
know it?  which is how it is displayed on the website,  html  
formated,  (i don't control the website).   is there a better process?


Jon.


On Oct 10, 2009, at 1:06 PM, Shawn Erickson wrote:

 (not how it is currently doing it but why does it need to load a  
page? what does it do with that loaded page?


___

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: real verses Virtual memory

2009-10-10 Thread jon

ok,  i'll do research on these..
Jon.

On Oct 10, 2009, at 1:25 PM, Shawn Erickson wrote:

It sounds like you need to get at the HTTP content itself and pull  
data out of that, right? If all you need is the HTTP content you can  
drop down to things like Foundation's URL Loading System [1], maybe  
drop down lower to CFNetwork [2], or use something like libcurl (as  
Greg suggested, possibly the better suggestion depending on your  
exact needs).


___

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: real verses Virtual memory

2009-10-10 Thread jon

using DOM,
Jon.

On Oct 10, 2009, at 1:28 PM, Shawn Erickson wrote:


using WebKit's DOM API to get at the pages content?


___

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: real verses Virtual memory

2009-10-10 Thread jon
oh... that is good to know...   hmm,  well it looks like i need to go  
lower in the mechanism,  stuff i don't know anything about,  so i'll  
do research on the best way to get the info off the website at a lower  
level.

Jon.

On Oct 10, 2009, at 1:33 PM, Jens Alfke wrote:

 Many large websites will ban your IP address if they find you  
repetitively fetching pages like 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: real verses Virtual memory

2009-10-10 Thread jon
wait,  if CFNetwork is doing the caching,   I would need to go lower  
to avoid it?   what would i use to get html or xml type of info off  
the website,  without giving the website pause for what i am doing?   
(or best guess on what a website might consider bad behavior)


Jon.


On Oct 10, 2009, at 1:33 PM, Jens Alfke wrote:

[4] The disk I/O you're seeing is almost certainly due to  
CFNetwork's caching and cookie mechanisms.


___

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: real verses Virtual memory

2009-10-10 Thread jon
oh i see (too late for that last post of mine)  that you are  
recommending NSURLConnection...   I'll look into that...
You are right, i am probably not needing WebView,  i only am using it,  
because that is what i founddrives me crazy the  
documentation...   it is there,   but you have to know what to look  
for before you ever go down the correct tangent.


Jon.

On Oct 10, 2009, at 1:33 PM, Jens Alfke wrote:

[5] You haven't described any functionality that requires using a  
WebView. All you need, I think, is NSURLConnection to fetch


___

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: real verses Virtual memory

2009-10-10 Thread jon

that looks promising...
thanks,
Jon.

On Oct 10, 2009, at 3:26 PM, Jens Alfke wrote:

 You can check the "Last-Modified" and "ETag" headers in the  
NSHTTPURLResponse object and compare them to what you got last time;


___

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: real verses Virtual memory

2009-10-10 Thread jon
i was using a notification that was standard that told me when the  
page finished loading...   does this have the same sort of mechanism?   
(or need it)  when fetching the page?


On Oct 10, 2009, at 3:26 PM, Jens Alfke wrote:


If you can't use a feed, use NSURLRequest to fetch the page


___

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


wake the screen up for an Application event...

2009-10-13 Thread jon
I can not find a method yet that will wake the display up from  
sleep,   (if a certain type of event occurs in an Application,  like  
an NSAlert,  i want the app itself to wake up the display).


thanks in advance.
Jon.
___

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


unsleep the display programatically?

2009-10-18 Thread jon
can you unsleep the display programatically?   i haven't found a  
method yet for doing it?


Jon.
___

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: unsleep the display programatically?

2009-10-18 Thread jon
no,  not the machine sleep,  just the display sleep...the  
situation would be a process that runs longer than the current display  
sleep time,  which then pops up an alert,   which no one can see,  
since the display is asleep...


Jon.

On Oct 18, 2009, at 7:12 PM, Mark Ritchie wrote:


Hrm... In what situation would you want to do such a thing?
And what if the user has set security to require a password after  
being in sleep?


___

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: unsleep the display programatically?

2009-10-18 Thread jon
Hi David,   that would not work,  because the display does need to  
sleep,  it would be working a long time,   and at nightbut  
needs to let people know that it is done.   i have an alarm go off,  
but people can know it has gone off  much better from a distance if  
suddenly the room is filled with light from the display waking up.


surely there is a method for this?  wouldn't there be?

Jon.

On Oct 18, 2009, at 7:25 PM, David LeBer wrote:


On 2009-10-18, at 9:15 PM, jon wrote:

no,  not the machine sleep,  just the display sleep...the  
situation would be a process that runs longer than the current  
display sleep time,  which then pops up an alert,   which no one  
can see, since the display is asleep...


Jon.

On Oct 18, 2009, at 7:12 PM, Mark Ritchie wrote:


Hrm... In what situation would you want to do such a thing?
And what if the user has set security to require a password after  
being in sleep?


Maybe prevent display sleep while your process is running?

<http://developer.apple.com/mac/library/qa/qa2004/qa1340.html>

;david


___

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: unsleep the display programatically?

2009-10-18 Thread jon

worth a try anyway,   I'll try tomorrow.
thanks,
Jon.

On Oct 18, 2009, at 7:36 PM, David LeBer wrote:


UpdateSystemActivity(UsrActivity);


___

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: unsleep the display programatically?

2009-10-19 Thread jon
that will work,   because that will remind them to change that  
preference,   thanks for doing that.


Jon.


On Oct 19, 2009, at 1:13 AM, Mark Ritchie wrote:

After a short time of no password being entered, the screen will go  
back to sleep


___

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


NSString after an UIAlertView..

2010-03-18 Thread Jon
I have a class set up,   and in the header file,  I have instances of NSString  
that i want to hang around for all the methods of the class to be able to 
use...(why they are declared in the header file).  when i create an instance of 
the class to use  I have a problem.

I create one instance of this class that hangs around while the whole program 
is executing...  or even if it is just called up for a short time..  (this is a 
view type of class that creates a subView over the main view...  ..

several of those methods in the class call UIAlertView, and suddenly the 
information in the NSStrings that i had instanced in the header of the class 
and am actively using,  disappears  each time a method calls up a 
UIAlertView..  i think because it is creating its own subview on top of 
everything and all the strings instances are lost at that moment...

so the question is:what is the best way to keep "strings"  around that i 
deem important enough to still have them  after a call to UIAlertView.??

Jon.
___

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: NSString after an UIAlertView..

2010-03-19 Thread jon
sorry,  I have not spoken in objective C in an email much as you can tell,  
(tried to translate)  my terms of course are all incorrect..

the NSStrings are not instanced in the header,  only declared,  if that is the 
proper word...

the are given values in the methods.

and when an UIAlertView is "instanced"  if that is proper,   then afterward,  
the string instance is "out of scope"   

I had made the assumption before that this is normal,  but it maybe not normal, 
 I'm looking for a bug in my code,  but i don't see anything yet..

basically if i set a string (put something in the string) just before an 
"instance" of UIAlertView is created and then released, i look in the 
string afterward and it is out of scope.

Jon.


On Mar 19, 2010, at 11:06 AM, Fritz Anderson wrote:

> I am stymied by imprecision in your questions.

___

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


UIView as opposed to UIViewController...

2010-03-06 Thread Jon
I get indications from reading that you shouldn't really subclass UIView in 
general or to do routine things,  and that any time you implement drawRect in 
the subclass of a UIView,   you are taking a performance hit compared to doing 
some drawing in other ways?

is this true,  in the case of doing this in the ViewController,  is this below 
more efficient?  or better?  or what?


- (void)viewDidLoad {
[super viewDidLoad];

trailersViewPlane = [[UIImageView alloc] initWithImage:nil];
trailersViewPlane.frame = self.view.frame;
theBounds = CGRectMake(0, 0, trailersViewPlane.frame.size.width, 
trailersViewPlane.frame.size.height);
[self.view addSubview:trailersViewPlane];

then drawing within an NStimer loop in this added subView inside the 
viewController?  (the subview bounds are as big as the whole view)

etc

I guess i am not sure which way to go..  (do everything in a UIView subclass,  
or do everything in a UIViewController subclass.)

it doesn't seem like anything you do in the controller,  is easy to get to draw 
in a UIView subclass,  and maybe equally hard to get stuff to translate over to 
the controller if you do a lot of work in the UIView...

i'm just lost as to how an NSTimer and a looping set of code should be worked 
into these two classes..   should it be in the UIView? or the Controller?  
seems like it should be in the controller,  but then really all the work has to 
be in the controller, since you can't even call the drawRect while in the 
controller,  so what would you do in the UIView?

any of that make sense? 

thanks in advance,
Jon.


___

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


MoviePlayer_iPhone sample code in XCode 3.2

2010-03-09 Thread Jon
I just tried the MoviePlayer_iPhone sample code in simulator 3.2, (i 
believe i am running beta 2)

while it works if you set it to 3.1,   as soon as you set it to 3.2,  the 
"local' movie no longer plays?

can someone confirm,   and a possible reason/solution?

thanks in advance.
Jon.
___

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: DOMNode problems getting info out...

2009-08-23 Thread jon
ok,  this seems mighty round about,   but this works   let me know  
if you think there is a simpler way...  i found atleast two sets of  
documentation on this from "developer/Apple" on DomNodes or  
DOMObjects  neither had the same info... but combining the two,  i  
think i figured it out...



DOMDocument *myDOMDocument = [[myWebView mainFrame] DOMDocument];
DOMNodeList *allParas = [myDOMDocument getElementsByTagName:@"p"];

DOMNode *node = [allParas item:0];

DOMNodeList *nodeList = [node childNodes];


DOMHTMLLinkElement* link = (DOMHTMLLinkElement*)[nodeList  
item:1];


NSString* href = [link href];

NSString *top = [node textContent];


now href conatins a string with the link in it,  and top contains the  
rest of the text within the "paragraph"...

this is the paragraph example again:

 Aug 19 - http://whatever/sys/1331140637.html";>Two 1GB  
Apple matched pair RAM from a MacBook - $30 -  
(Louisville )


Jon.





On Aug 23, 2009, at 8:06 AM, jon wrote:

I have found that there is extremely limited documentation dealing  
with DOMNodeLists and DOMNode...


for instance i found by pure accident  that textContent works on a  
node,  and found no documentation on it...  and lots references to  
getAttribute or getElementID  but can not get them to work...


so here is what i'm trying to do with code and maybe someone has  
figured this out...


thanks in advance..

here is some data in some HTML that I would like to parse,   i've  
found how to get the text out,   but i can't get this URL out


 Aug 19 - http://whatever/sys/1331140637.html";>Two 1GB  
Apple matched pair RAM from a MacBook - $30 -  
(Louisville )



here is the code i'm using to parse it   most of it works,   
including the textContent,   last two lines don't work...trying to  
get this "http://whatever/sys/1331140637.html";  into a NSString, or  
NSURL is failing me...



DOMDocument *myDOMDocument = [[myWebView mainFrame] DOMDocument];
DOMNodeList *allParas = [myDOMDocument getElementsByTagName:@"p"];

DOMNode *node = [allParas item:0];

NSString *top = [node textContent];


	NSString *top2 = [node getAttribute:@"href"]; // this is way  
off, just trying to find methods,  but i expected getAttribute to  
atleast be acknowledged as a method
	NSString *top4 = [node getElementById:@"href"];   // this is way  
off,  but i expected getElementById to atleast be acknowledged as a  
method



any help would be great...
thanks,
Jon.


___

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


DOMNode problems getting info out...

2009-08-23 Thread jon
I have found that there is extremely limited documentation dealing  
with DOMNodeLists and DOMNode...


for instance i found by pure accident  that textContent works on a  
node,  and found no documentation on it...  and lots references to  
getAttribute or getElementID  but can not get them to work...


so here is what i'm trying to do with code and maybe someone has  
figured this out...


thanks in advance..

here is some data in some HTML that I would like to parse,   i've  
found how to get the text out,   but i can't get this URL out


 Aug 19 - http://whatever/sys/1331140637.html";>Two 1GB  
Apple matched pair RAM from a MacBook - $30 -  
(Louisville )



here is the code i'm using to parse it   most of it works,   
including the textContent,   last two lines don't work...trying to get  
this "http://whatever/sys/1331140637.html";  into a NSString, or NSURL  
is failing me...



DOMDocument *myDOMDocument = [[myWebView mainFrame] DOMDocument];
DOMNodeList *allParas = [myDOMDocument getElementsByTagName:@"p"];

DOMNode *node = [allParas item:0];

NSString *top = [node textContent];


	NSString *top2 = [node getAttribute:@"href"]; // this is way off,  
just trying to find methods,  but i expected getAttribute to atleast  
be acknowledged as a method
	NSString *top4 = [node getElementById:@"href"];   // this is way  
off,  but i expected getElementById to atleast be acknowledged as a  
method



any help would be great...
thanks,
Jon.
___

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


NSDateFormatter bug in timeZone

2009-04-26 Thread Jon

 it appears there is a bug in Apple's date formatter:

NSDateFormatter *inputFormatter = [[NSDateFormatter 
alloc] init];
[inputFormatter setDateFormat:@"MMM-dd-yy HH:mm:ss 
zzz"];
			NSDate *theDate = [inputFormatter dateFromString:@"Apr-04-09  
10:30:03 PDT"];


this gives the wrong timezone in "theDate"??? (unless of course you  
happen to be in the PDT timezone)it looks like it ignores the  
format, and just puts in current time zone. it should be   -0700   
at the end of the "theDate" if you look at it in a debugger,  but it  
is wrong for anyone that is not in the PDT...



NSDateFormatter *inputFormatter = [[NSDateFormatter 
alloc] init];
[inputFormatter 
setFormatterBehavior:NSDateFormatterBehavior10_4];
			[inputFormatter setLocale:[[NSLocale alloc]  
initWithLocaleIdentifier:@"en_US"]];
			[inputFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT: 
0]];

[inputFormatter setDateFormat:@"MMM-dd-yy HH:mm:ss 
zzz"];

			NSDate *theDate = [inputFormatter dateFromString:@"Apr-04-09  
10:30:03 PDT"];


this gives me a NIL in "theDate"  because timeZoneForSecondsFromGMT   
is some how not working,  or i have it wrong.


also using the natural language formater properly gives me the correct  
time Zone,  but as soon as you store it in a Data Source,  it comes  
back out with the current time zone, and the time adjusted so that it  
is correct time at least...   but this shouldn't happen?  should it.


Jon.

___

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: NSDateFormatter bug in timeZone

2009-04-27 Thread jon
I was not  using the term Data Source properly most likely,  this is  
what i was doing..


NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:theDate forKey:@"the date"];

in a different Class object at a later time,  i retrieve it like this.

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSDate *theDate = [defaults objectForKey:@"the date"];

that is what i meant by storing the data...

(shouldn't PDT mean just one thing? shouldn't it be that simple?
I'll try your suggestion, thanks,   i'll try it with zzz, and with  
zzz)


(I'm not sure how to properly reply to the list yet,  should i reply  
to both You and the list? as i'm doing here)

thanks,
Jon.

On Apr 27, 2009, at 3:27 AM, Alastair Houghton wrote:



it appears there is a bug in Apple's date formatter:

NSDateFormatter *inputFormatter = [[NSDateFormatter 
alloc] init];
[inputFormatter setDateFormat:@"MMM-dd-yy HH:mm:ss 
zzz"];
			NSDate *theDate = [inputFormatter dateFromString:@"Apr-04-09  
10:30:03 PDT"];


this gives the wrong timezone in "theDate"??? (unless of course you  
happen to be in the PDT timezone)it looks like it ignores the  
format, and just puts in current time zone.


I'm not sure that things are quite as simple as you think :-)

The problem with the three-letter time zone codes is that many of  
them are ambiguous.  For instance, you might think EST meant UTC-5,  
whereas an Australian would expect EST to be UTC+10.  As a result,  
you probably need to specify a bit more information rather than just  
"PDT"; I'm not 100% certain, but the following *might* work:


 NSDate *theDate = [inputFormatter dateFromString:@"Apr-04-09  
10:30:03 PST8PDT"];


also using the natural language formater properly gives me the  
correct time Zone,  but as soon as you store it in a Data Source,   
it comes back out with the current time zone, and the time adjusted  
so that it is correct time at least...   but this shouldn't  
happen?  should it.


You can't store something in a data source, at least not for the  
usual Cocoa meaning of data source.   Data sources are a type of  
delegate object, usually one that you implement yourself (unless  
you're using bindings, in which case the system does it for you).


Where are you storing the date?  And in what form?  Are you using  
bindings or Core Data, or did you implement your own data source  
object?


___

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: NSDateFormatter bug in timeZone

2009-04-27 Thread jon

oh wait, you are saying the Australia has an EST...  I see.

in that case,  do you think Apple should have this work,  which i  
tried,  of having this line before making the final format call of  
just using PDT.


	[inputFormatter setLocale:[[NSLocale alloc]  
initWithLocaleIdentifier:@"en_US"]];


thanks,
Jon.

On Apr 27, 2009, at 3:27 AM, Alastair Houghton wrote:


Australian would expect EST


___

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


Make connections between One Button and two different NSObjects?

2009-05-04 Thread Jon
can you make two connections between One Button and two different  
NSObjects?


is it possible? to have two different IBActions go off?  or some other  
way of controlling a single button from two different objects?


I want a normal controller,   but then i want to hide,  and unhide the  
button from the actions of a different window


Jon.
___

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


quick and dirty NSData implosion

2009-05-08 Thread Jon
so far,  what i've determined by dumbing this down,   is that I must  
be doing something inherently bad and nubi like here...
the run time just completely implodes when it gets to the "NSData"  
line of code

any help would be great,   thanks in advance.
the "BookMark"  is just a class with the 3 items that you can see  
below in it,  and then uses the @property and @synthesize routines to  
set the setter and getter,  there is nothing else in the class.
I suspect that NSData's keyedArchiver is not expecting a mutable  
thing?   but NSUserDefaults only takes immutable things.


NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
BookMark *theBookMark = [[BookMark alloc] init];
NSString *theurl = @"http:/.anything.com/";

	NSMutableDictionary *bookMarkList = [[NSMutableDictionary alloc]  
initWithCapacity: 9];


bookMarkCount++;

[theBookMark setBookMarkCount:bookMarkCount];
[theBookMark setBookMarkurlString:theurl];
[theBookMark setBookMarkTitle:[docTitle substringToIndex:100]];

	NSString *countString = [NSString stringWithFormat:@"%d",  
bookMarkCount];


[bookMarkList setObject:theBookMark forKey:countString];

	NSData *bookMarkdata = [NSKeyedArchiver  
archivedDataWithRootObject:bookMarkList];


[defaults setObject:bookMarkdata forKey:PECBookMarkListKey];

___

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: quick and dirty NSData implosion

2009-05-08 Thread jon
yes i did try,   i would send the data,  and nothing would show up in  
the property list file.
but there would be no crash, no error,   nothing,  but no results  
either.   so after reading the same documentation you also saw,   I  
assumed it had to be NSDictionary, rather than NSMutableDictionary.
It is most likely the wrong assumption,  but i could get nothing from  
the line of code below.


here is the line i used...  simply substituting this in,  instead of  
the NSData stuff,   and atleast it doesn't crash and burn...  but it  
also produces nothing in the property list.


[defaults setObject:bookMarkList forKey:PECBookMarkListKey];

so again, I must be doing something fundamentally wrong here?

this also does not explain why the NSData line of code would implode,   
even if my assumption was wrong in that case,  something else must  
also be wrong there.

Jon.


On May 8, 2009, at 7:39 AM, Alexander Spohr wrote:


Why do you think that? Did you try?


___

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: quick and dirty NSData implosion

2009-05-08 Thread jon

in the debugger,  here are the last lines it followed...

#0	0x91b35de9 in -[NSCarbonMenuImpl  
performActionWithHighlightingForItemAtIndex:]

#1  0x91b35b07 in -[NSMenu performKeyEquivalent:]
#2  0x91b343ac in -[NSApplication _handleKeyEquivalent:]
#3  0x91a5116b in -[NSApplication sendEvent:]
#4  0x919ae69f in -[NSApplication run]
#5  0x9197b8a4 in NSApplicationMain
#6  0x210c in main at main.m:5

with your code below i get this if i use NSData line in place of the  
defaults line...   (the thing that was blowing up)


 NSData blew up because: *** -[BookMark encodeWithCoder:]:  
unrecognized selector sent to instance 0x1f900a40


so  this appears to be that my bookmark class does not have something  
in it that NSData needs?   or that i'm using property and synthesize ?


here is the class.   it appears that I need to do something to prepare  
it for NSData?


#import 

@interface BookMark : NSObject
{
int bookMarkCount;
NSString *bookMarkurlString;
NSString *bookMarkTitle;
}

@property(readwrite, assign) int bookMarkCount;
@property(readwrite, assign) NSString *bookMarkurlString;
@property(readwrite, assign) NSString *bookMarkTitle;

@end


#import "BookMark.h"

@implementation BookMark

@synthesize bookMarkCount;
@synthesize bookMarkurlString;
@synthesize bookMarkTitle;

@end



On May 8, 2009, at 8:04 AM, John Cebasek wrote:


Why don't you do something like this:

@try
{
	NSData *bookMarkdata = [NSKeyedArchiver  
archivedDataWithRootObject:bookMarkList];

//   [defaults setObject:bookMarkList forKey:PECBookMarkListKey];
}
@catch (NSException *e)
{
NSLog(@"NSData blew up because: %@", [e reason]);
}


___

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: quick and dirty NSData implosion

2009-05-08 Thread jon
sorry, I am getting emails out of order because i'm using the option  
that sends list in a bundle,  so getting the ones that reply directly  
to me first,  so  i am looking for Dave's answer now...

thanks,
Jon.

On May 8, 2009, at 8:40 AM, Alexander Spohr wrote:


So what are you asking for? It’s right there in your face:
Your BookMark does not implement encodeWithCoder: an is therefore  
not NSCoding compliant.

Just what Dave said.
Implement it and it should work.


___

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-dev Digest, Vol 6, Issue 702

2009-05-08 Thread Jon
ya, that would be a big problem,   I'm looking at how to do "NSCoding"  
for a class now...
thanks,  hey,  at least i knew i was doing something fundamentally  
wrong...

nubi Jon.

On May 8, 2009, at 8:21 AM, cocoa-dev-requ...@lists.apple.com wrote:


And just to make sure... your Bookmark class does implement NSCoding,
correct?  That's required by NSKeyedArchiver.


___

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


Debugger's "global browser" does not show any globals?

2009-05-11 Thread jon

I'm hoping someone has an easy answer for this,  or has seen it,

Most of the time,  when i'm in the debugger, if i go to the "global"  
option,  and i see the list of frameworks and my application,   if i  
click on anything, it shows 0/0 global variables...  basically nothing.


but every once in a while,  I'll see my application with the correct  
globals?   I'm not sure the difference...


I hope this is familiar to someone,  I'd love to figure this one  
out.   I hope it is not a common question...  not sure how to search  
the list yet.


thanks in advance,
Jon.
___

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


NSString and retain.

2009-05-11 Thread jon
from my very limited Objective-C programing experience of all of 10  
days...


it appears to me that my assignments to NSStrings seem to, at random,  
disappear. (i, being a new Objective-C programmer coming from  
pascal and C,  like to have a "global" string in several places,  not  
that it is correct or anything, but i still would like to know what is  
going on when i do keep a string around for a good long time in the  
application)  (or any other object for that matter)


I attribute it so far to my lack of understanding garbage collection  
and retaining objects...


my wild guess right now is to do this below when ever i have the  
"NSString" instance assignment to prevent, for instance, "theTitle"  
from "randomly disappearing"...


ok,  tell me how badly this will go wrong... (although this would be  
more like "theTitle" is declared in an area that is global, and then  
assigned later.)


I do know that "NSSTring" is "different" than other objects,  but i'm  
not sure how,  they do appear to act like other objects though as far  
as i can tell.

thanks in advance,
Jon.

NSString *theTitle = [[defaults stringForKey:@"the title"] retain];

___

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: quick and dirty NSData implosion

2009-05-11 Thread jon


On May 8, 2009, at 6:56 PM, Graham Cox wrote:

You can help yourself out with this type of thing by declaring your  
classes properly. If you need it to be NSCoding compliant (as you  
do), then ensure it subscribes to the protocol:


@interface BookMark : NSObject 



I think i have the Protocol set up correct now,  but i still have  
something incorrect,  I set up a test case to check it, and instance   
"theBookMark" does not return what was put into it in the last line of  
code below.


actually "bookMarkCount"  returns the correct integer, but the two  
strings are left as invalid?   just putting in constant strings rather  
than reading from a file makes the code smaller to test,  but produced  
the same result.


here is the class for BookMark, and the code below it that i used to  
test it "theBookMark" instance has the correct strings in it just  
before the last line of code.


Jon.

#import 

@interface BookMark : NSObject 
{
int bookMarkCount;
NSString *bookMarkurlString;
NSString *bookMarkTitle;
}

@property(readwrite, assign) int bookMarkCount;
@property(readwrite, assign) NSString *bookMarkurlString;
@property(readwrite, assign) NSString *bookMarkTitle;

@end


#import "BookMark.h"

@implementation BookMark

@synthesize bookMarkCount;
@synthesize bookMarkurlString;
@synthesize bookMarkTitle;

- (id)initWithCoder:(NSCoder *)c
{
[super init];
bookMarkCount = [c decodeIntForKey:@"bookMarkCount"];
bookMarkurlString = [c decodeObjectForKey:@"bookMarkurlString"];
bookMarkTitle = [c decodeObjectForKey:@"bookMarkTitle"];
return self;
}

- (void)encodeWithCoder:(NSCoder *)c
{
[c encodeInt:bookMarkCount forKey:@"bookMarkCount"];
[c encodeObject:bookMarkurlString forKey:@"bookMarkurlString"];
[c encodeObject:bookMarkTitle forKey:@"bookMarkTitle"];
}

@end



NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
BookMark *theBookMark = [[BookMark alloc] init];

	NSMutableDictionary *bookMarkList = [[NSMutableDictionary alloc]  
initWithCapacity: 1];


bookMarkCount++;
NSString *theurl = [defaults stringForKey:@"the url"];
NSString *theTitle = [defaults stringForKey:@"the title"];

[theBookMark setBookMarkCount:bookMarkCount];
[theBookMark setBookMarkurlString:theurl];
[theBookMark setBookMarkTitle:theTitle];


	NSString *countString = [NSString stringWithFormat:@"%d",  
bookMarkCount];


[bookMarkList setObject:theBookMark forKey:countString];

	NSData *bookMarkdata = [NSKeyedArchiver  
archivedDataWithRootObject:bookMarkList];



[defaults setObject:bookMarkdata forKey:PECBookMarkListKey];
[defaults synchronize];


	bookMarkList = [NSKeyedUnarchiver  
unarchiveObjectWithData:bookMarkdata];


theBookMark = [bookMarkList objectForKey:countString];




___

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


example "miniBrowser" setting Garbage collection to "supported"

2009-05-13 Thread jon
in the "miniBrowser" project that comes with the Developer SDK on your  
disk under WebKit,  and with the only change of  setting Garbage  
collection to "supported" in the build settings...  (plus i think i  
set things to 10.5, and other updated settings)


and then using the running app to go to "www.ebay.com",   some of the  
java scripts will no longer load on that page.   to compare see the  
same site in safari...


changing the miniBrowser back to garbage collection of "unsupported"  
brings back the extra loads of java scripts (i believe they are java)


does anyone know what is being Interfered with?   I can't find  
anything in the code that is doing this?


(also,  does what i'm describing happen on your development  
environment?)


thanks in advance,
Jon.
___

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: example "miniBrowser" setting Garbage collection to "supported"

2009-05-13 Thread jon
i've tested this with no changes except the "supported" garbage  
collection now with same results.  I don't have snow.  I'll send bug  
report #


 i'd really like to isolate this to the particular code that is  
causing this,  but have been unsuccessful...  not much left i can turn  
off.

Jon.


On May 13, 2009, at 3:02 PM, Bill Bumgarner wrote:

in the "miniBrowser" project that comes with the Developer SDK on  
your disk under WebKit,  and with the only change of  setting  
Garbage collection to "supported" in the build settings...  (plus i  
think i set things to 10.5, and other updated settings)


___

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: Custom time picker

2015-12-02 Thread Jon Hull
Hi Eric,

When creating similar controls in the past (I am actually making an odometer 
style view right now), I have found that collection views work really well. 
There is a delegate call (something like proposedOffset:forTargetOffset:) which 
gives you the sticky behavior you desire...

Thanks,
Jon

Sent from my iPhone

> On Dec 2, 2015, at 4:22 PM, Eric Dolecki  wrote:
> 
> I need to create a time picker control but don't have much vertical room. So 
> buttons above and below to affect hours, min, am/pm are out. I was thinking 
> swipes up and down. Best to use 3 UIScrollviews? Inertia is there. Only thing 
> is how to get the numbers to "stick" in selection position while still 
> allowing for smooth scrolling with quick flicking. Technique for that?
> Is this a good solution? Anything I might consider?
> ___
> 
> 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/jhull%40gbis.com
> 
> This email sent to jh...@gbis.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

NSString stringByAbbreviatingWithTildeInPath and Sandboxing

2015-01-27 Thread Jon Baumgartner
My app uses this call, and it worked fine until I sandboxed it. The 
documentation for this call says:

> For sandboxed apps in OS X, the current home directory is not the same as the 
> user’s home directory. For a sandboxed app, the home directory is the app’s 
> home directory. So if you specified a path of /Users//file.txt 
> for a sandboxed app, the returned path would be unchanged from the original. 
> However, if you specified the same path for an app not in a sandbox, this 
> method would replace the /Users/ portion of the path with a 
> tilde.

So how do I get /Users//file.txt to output as ~/file.txt when my 
app is sandboxed?
___

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: NSString stringByAbbreviatingWithTildeInPath and Sandboxing

2015-01-27 Thread Jon Baumgartner
Yeah. The app is specifically for copying paths, and applying various 
transformations to the path. Developers use it but also general users.



On January 27, 2015 at 2:03:46 PM EST, Jens Alfke  wrote:On 
Jan 27, 2015, at 9:20 AM, Jon Baumgartner  
wrote: So how do I get /Users//file.txt to output as ~/file.txt 
when my app is sandboxed?Why do you need it to? That’s not the kind of path 
you should be displaying in the UI, because it won’t make sense to anyone but 
geeks. Is this a developer-focused app? —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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: NSString stringByAbbreviatingWithTildeInPath and Sandboxing

2015-01-29 Thread Jon Baumgartner

I’m happy to do this, but is this really a bug? I was just thinking there might 
be an alternate way to accomplish this.

On 1/27/2015 4:03 PM, Kyle Sluder wrote:

Could you please file a Radar describing your use case and share the
number here?




___

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: NSString stringByAbbreviatingWithTildeInPath and Sandboxing

2015-02-04 Thread Jon Baumgartner
I filed a radar: rdar://19716583

On Thu, Jan 29, 2015 at 10:55 AM, Kyle Sluder  wrote:

> Even in a sandbox, you can get the user’s home directory using getpwuid(3)
> as mentioned in the docs:
> https://developer.apple.com/library/mac/documentation/Security/Conceptual/AppSandboxDesignGuide/DesigningYourSandbox/DesigningYourSandbox.html
>
> So you could just search through your string and replace occurrences of
> that with a tilde, but then you have to worry about encodings and all that
> muck. Since there’s no security risk here, it’s reasonable to ask that the
> existing API work in a sandbox too.
>
> --Kyle Sluder
>
> > On Jan 29, 2015, at 7:45 AM, Jon Baumgartner <
> j...@bergenstreetsoftware.com> wrote:
> >
> > I’m happy to do this, but is this really a bug? I was just thinking
> there might be an alternate way to accomplish this.
> >
> >> On 1/27/2015 4:03 PM, Kyle Sluder wrote:
> >> Could you please file a Radar describing your use case and share the
> >> number here?
> >>
> >>
> >
>
___

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: NSString stringByAbbreviatingWithTildeInPath and Sandboxing

2015-03-05 Thread Jon Baumgartner
That bug has gotten no response whatsoever from Apple. Any advice on how to 
proceed? 

> On Feb 4, 2015, at 1:19 PM, Jon Baumgartner  
> wrote:
> 
> I filed a radar: rdar://19716583
> 
> 
> On 1/29/2015 10:55 AM, Kyle Sluder wrote:
>> Even in a sandbox, you can get the user’s home directory using getpwuid(3) 
>> as mentioned in the docs: 
>> https://developer.apple.com/library/mac/documentation/Security/Conceptual/AppSandboxDesignGuide/DesigningYourSandbox/DesigningYourSandbox.html
>> 
>> So you could just search through your string and replace occurrences of that 
>> with a tilde, but then you have to worry about encodings and all that muck. 
>> Since there’s no security risk here, it’s reasonable to ask that the 
>> existing API work in a sandbox too.
>> 
>> --Kyle Sluder
>> 
>>> On Jan 29, 2015, at 7:45 AM, Jon Baumgartner 
>>>  wrote:
>>> 
>>> I’m happy to do this, but is this really a bug? I was just thinking there 
>>> might be an alternate way to accomplish this.
>>> 
>>>> On 1/27/2015 4:03 PM, Kyle Sluder wrote:
>>>> Could you please file a Radar describing your use case and share the
>>>> number here?
>>>> 
>>>> 
> 


___

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: NSString stringByAbbreviatingWithTildeInPath and Sandboxing

2015-03-06 Thread Jon Baumgartner

> On Mar 5, 2015, at 2:29 PM, Jens Alfke  wrote:
> 
> 
> I wouldn’t expect a response from Apple in ‘only’ a month, except perhaps to 
> notify you that it’s a duplicate.
> 
> If they do fix the bug, you won’t get a notification until there’s a 
> developer release of the OS update so you can test the fix. And since this is 
> a pretty minor bug in the grand scheme of things, I wouldn’t expect a fix in 
> a dot-dot release. So I’d be guessing the earliest you might hear back about 
> a fix is around WWDC (June?) when there’s hypothetically a DP of 10.11.
> 
> Until then you’ll need to work around it.

Okay, thanks. I guess I was expecting at least a “we’re looking into this” or 
“we won’t touch this” sort of reply. I think I can find a workaround for now. 
___

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

init for immutable classes

2009-09-18 Thread Jon Hull

Hello,

I am writing a framework which runs on both Snow Leopard and the  
iPhone (i.e. it is entirely foundation stuff).


I always write my init and dealloc methods using the setter functions,  
but I am wondering what the proper convention is for immutable  
classes?  Should I write a private setter method, or is it ok to just  
set the variable in init and release it in -dealloc.  Thus:


Option 1)
-(id)initWithValue:(id)aValue
{
if(self=[super init]){
[self setValue:aValue];
}
return self;
}

-(void)dealloc
{
[self setValue:nil];
[super dealloc];
}

Option 2)
-(id)initWithValue:(id)aValue
{
if(self=[super init]){
_value = [aValue copy];
}
return self;
}

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

Is ether one better for a particular reason, or are they both ok, and  
it is just a matter of style?  I am thinking that the second is  
probably better, because even a 'private' method could get called from  
outside of the class, and I couldn't guarantee it's immutability  
anymore.  That is so different from what I normally do (I was taught  
to always use setter methods) that I wanted to check with the list  
first...


Thanks,
Jon
___

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


NSMenuItem & NSRuleEditor

2009-09-26 Thread Jon Hull
I must be missing something in the documentation.  I am trying to  
populate a Rule Editor  with choices from a plist file.  The plan is  
to create and return an NSMenuItem for each string stored in the  
corresponding spot in a plist.  Here is what IS working:
  • I can get the NSRuleEditor to display menuItems from a popup  
loaded from the XIB (as in the example I found)
  • I can load in the plist and confirm that the resulting dictionary/ 
array structure as well as the return values for the #ofChildren  
method are correct


But when I create an NSMenuItem programmatically instead of grabbing a  
pre-made one, no menu shows up in the rule editor (only blank rows)...


I have tried disconnecting this from my data structure and just  
creating a fixed item with the same effect.  I can only assume I am  
creating the NSMenuItem incorrectly.


Here is the relevant code: (please excuse the lack of type checking &  
other error code... it will be added once I get it working... I have  
checked the debugger and the types are correct)


-(NSMenuItem*)menuItemForKey:(NSString*)key index:(NSUInteger)index
{
if(key==nil)
return nil;
	NSArray *children = [plistDictionary objectForKey:key];// 
plistDictionary contains a tree of children

NSString *title = [children objectAtIndex:index];
if([title isEqualToString:@"-"])
return [NSMenuItem separatorItem];
	return [[[NSMenuItem alloc]initWithTitle:title action:NULL  
keyEquivalent:@""]autorelease];

}

- (id)ruleEditor:(NSRuleEditor *)editor child:(NSInteger)index  
forCriterion:(id)criterion withRowType:(NSRuleEditorRowType)rowType

{
NSString *key;
if (criterion) {
key = [criterion title];
}else {
key = @"Header";
}

return [self menuItemForKey:key index:index];
}

Any help is appreciated!

Thanks,
Jon___

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: NSMenuItem & NSRuleEditor

2009-09-26 Thread Jon Hull
It is called.  I just figured out a workaround... apparently if I pass  
it a string NSRuleEditor will create a menuItem for me.  Just tested  
and it is working now.  The documentation is so bad on this area,  
maybe I will post some example code when I get it all worked out...


Thanks for your help :-)

Jon


On Sep 26, 2009, at 1:27 PM, Andy Lee wrote:


On Sep 26, 2009, at 4:09 PM, Jon Hull wrote:
• I can get the NSRuleEditor to display menuItems from a popup  
loaded from the XIB (as in the example I found)
• I can load in the plist and confirm that the resulting dictionary/ 
array structure as well as the return values for the #ofChildren  
method are correct


But when I create an NSMenuItem programmatically instead of  
grabbing a pre-made one, no menu shows up in the rule editor (only  
blank rows)...

[...]
- (id)ruleEditor:(NSRuleEditor *)editor child:(NSInteger)index  
forCriterion:(id)criterion withRowType:(NSRuleEditorRowType)rowType


Did you check whether this method is actually called -- not just  
that your data structure is what you think it is, but that this  
method is being executed?  The typical suggestion here would be to  
make sure you remembered to connect your object as the delegate of  
the rule editor.


--Andy





___

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 radar sweep effect

2009-09-27 Thread Jon Gilkison
You can do this with a single accumulating bitmap.
1. Create a bitmap the size of your view filled with the background color
2. Fill the bitmap with the background color using an alpha = 1 / number of
steps
3. Draw the radar onto the bitmap
4. Draw the bitmap in the view
5. Go to step 2

(I have done this exact thing on Win32, but not Cocoa so buyer beware).
___

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


Saving for iPhone - Can core data handle this?

2009-10-12 Thread Jon Hull
I have a game project for the iPhone which has a rather complicated  
object graph


There is a large graph of tiny immutable objects which represent the  
story (including different branches of the storyline).  This graph is  
large enough that I only want to keep the nodes that are actually  
being used in memory.  There is also a separate graph of game objects  
(characters, etc...) that change state over time and will need to be  
saved as part of a saved game.  These seem like they should be stored  
separately since one never changes and will be common for all players,  
while the other is different for each player.  I also want to be able  
to get a fresh copy of the changing objects for new games.


The final complication is that I have several proxies being used in an  
important way, and I don't think there is any NSProxy equivalent for  
NSManagedObject.  I guess I would just have to hope that  
NSManagedObject doesn't have any methods that the targets of the proxy  
override.


I have been reading the docs for Core Data, and have a rough idea on  
how I might accomplish all of this, but I wanted to see if someone had  
experience with this and could keep me from spending time going down  
the wrong path if it isn't going to work.


So, do you think core data can handle this?  What approach (roughly)  
should I use?


Thanks,
Jon
___

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


  1   2   3   4   >