Re: Detect dim/brightness keys on laptop

2009-12-26 Thread Michael Davey
As far as I know, the system provides you with this choice.

On 26 Dec 2009, at 01:01, John Clayton wrote:

 Hi All
 
 I there a way to detect, on a system wide basis, that the dim/brightness keys 
 (or volume keys) have been pressed?
 
 I tried using the event-tap API using a HID + head based intercept, running 
 as root with assistive access switched on, but even that doesn't receive the 
 events.
 
 My aim is to write a little util that swaps the function keys depending on 
 which app is running (i.e. so that during certain apps you don't have to use 
 the FN key on the laptop to get F1).  So I need to have the ability to modify 
 the event stream - e.g. exactly what event taps provides.
 
 The only fly in the soup so far is that the brightness (F1 and F2 as well as 
 the volume keys) are not seen by the event tap spike program that Ive written.
 
 Looking forward to any tips - thanks.
 --
 John Clayton
 ___
 
 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/frak.off%40gmail.com
 
 This email sent to frak@gmail.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


How can I make an NSTableView update its display on command?

2009-12-26 Thread Daniel Wambold
Hello List,
I am writing a CoreData app with an entity controller bound to an NSTableView, 
with the bindings created programmatically. Periodically, the program creates a 
new NSManagedObject, sets default values, and adds it to the MOC. This works 
fine. However, the NSTableView does not update its display until I mouse over 
it. In a given period of time, several objects may have been added, but they do 
not appear until the pointer enters the NSTableView onscreen. I have tried each 
of the following, then commented them out when they failed:

NSLog (@Have we updated yet?\n);

// 1 // [myTableViewOutlet reloadData];

// 2 // [myTableViewOutlet lockFocus];
//  [myTableViewOutlet display];
//  [myTableViewOutlet unlockFocus];

// 3 // [myTableViewOutlet viewWillDraw];

// 4 // [myTableViewOutlet lockFocus];
[myTableViewOutlet drawRect:[myTableViewOutlet bounds]];
[myTableViewOutlet unlockFocus];

// 5 // [[myTableViewOutlet superview] setNeedsDisplay:YES];

// 6 // [myTableViewOutlet lockFocus];
//  NSRect myTableViewNewRowRect = [myTableViewOutlet 
rectOfRow:([myTableViewOutlet numberOfRows]-1)];
//  [myTableViewOutlet drawRow:([myTableViewOutlet numberOfRows]-1) 
clipRect:myTableViewNewRowRect];
//  [myTableViewOutlet unlockFocus];

// 7 // [myTableViewOutlet scrollRowToVisible:([myTableViewOutlet 
numberOfRows]-1)];

Any hints on how to make this view update itself on command. I realize its 
deferred updating is probably the result of the runtime trying to be efficient, 
but these new object events only occur about once every 5 minutes, and the end 
user is not going to understand why none appear for a while, then a whole bunch 
suddenly pop into view when they move the mouse.

Thanks!
-Dan___

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: How can I make an NSTableView update its display on command?

2009-12-26 Thread Daniel Wambold
Sorry. It was NOT the NSTableView's problem. I neglected to add:

[[self managedObjectContext] processPendingChanges];

after the NSManagedObject was created. Please disregard the previous post.

Best Regards,
Dan
___

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

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

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

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


IPhone app passing info into Desktop app

2009-12-26 Thread Chad Eubanks

Good Morning developers,

Does anyone know of an example that has an iPhone app passing  
information to a desktop app?  Could this be done with CoreData or  
should I be looking into a webview based app?


Kind Regards and Happy Coding,

Chad Eubanks

Sent from my iPhone
___

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: UITextfield print to NSLog

2009-12-26 Thread Chad Eubanks

Yandy,

Thank you for the response and info but can you please elaborate a  
little more.  Would NSLog be in my


-(void)viewdidbeginediting {
}

???

Chad Eubanks

Sent from my iPhone

On Dec 25, 2009, at 11:52 PM, Yandy Ramirez yan...@gmail.com wrote:


Assuming your UITextField is an IBOutlet, simple way:

NSLog(@%@, self.myTextField.text);

you can also implement the UITextFieldDelegate and pass the  
textField value as you begin editing, once it's done editing and so  
forth.



--
yandy


On Fri, Dec 25, 2009 at 6:49 PM, Chad Eubanks  
chadcreat...@gmail.com wrote:

Hello,

I'm working on an iPhone app and need help passing entered text from  
a UITextfield into NSLog.  Any thoughts?


Happy Holidays,

Chad Eubanks

Sent from my iPhone
___

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

This email sent to yan...@gmail.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: UITextfield print to NSLog

2009-12-26 Thread David Duncan
On Dec 26, 2009, at 6:58 AM, Chad Eubanks wrote:

 Yandy,
 
 Thank you for the response and info but can you please elaborate a little 
 more.  Would NSLog be in my
 
 -(void)viewdidbeginediting {
 }
 


Hard to know where you should put it, since you don't tell us what you are 
trying to accomplish. If you want to print the text in a text view, Yandy has 
told you how – but where you put it will depend on what your purpose for 
printing it is in the first place
--
David Duncan
Apple DTS Animation and Printing

___

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

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

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

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


Core Data Fetch Invariance

2009-12-26 Thread Richard Somers
Objects in a persistent store are unordered. If I fetch the objects,  
change nothing in the store, then fetch them again, do the two fetches  
give me the objects in the same order?


--Richard

___

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: Core Data Fetch Invariance

2009-12-26 Thread Bill Bumgarner

On Dec 26, 2009, at 9:38 AM, Richard Somers wrote:

 Objects in a persistent store are unordered. If I fetch the objects, change 
 nothing in the store, then fetch them again, do the two fetches give me the 
 objects in the same order?

Maybe.   Behavior is undefined.

b.bum

___

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: Core Data Fetch Invariance

2009-12-26 Thread Greg Reichow
Your first comment was correct; they are unordered.  The fact that they may 
come back in the same order is not guaranteed by the API.  Therefore, if you 
need ordering, add an attribute to the core data object to do so.

Greg

On Dec 27, 2009, at 1:38 AM, Richard Somers wrote:

 Objects in a persistent store are unordered. If I fetch the objects, change 
 nothing in the store, then fetch them again, do the two fetches give me the 
 objects in the same order?
 
 --Richard
 
 ___
 
 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/gdr3941%40mac.com
 
 This email sent to gdr3...@mac.com

___

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

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

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

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


Re: IPhone app passing info into Desktop app

2009-12-26 Thread Andrew Farmer
On 26 Dec 2009, at 06:54, Chad Eubanks wrote:
 Does anyone know of an example that has an iPhone app passing information to 
 a desktop app?  Could this be done with CoreData or should I be looking into 
 a webview based app?

Neither CoreData nor WebView are appropriate technologies for what you're 
describing. CoreData's purpose is managing object graphs, and WebView's purpose 
is displaying web pages. Neither one is particularly proficient at contacting a 
remote system and transferring data*.

Depending on what you're wanting to do here, you'll probably want to look into 
either Sync Services or Bonjour / sockets.

(*: While WebView superficially fits the bill, it's the wrong approach 
entirely.)___

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


Source List Indentation Drawing Issue

2009-12-26 Thread Carmen Cerino Jr.
Howdy,

I have been having a hard time trying to track down information on this
issue, mostly because its a rather difficult to describe. The best summary I
can give is that if you set an NSOutlineView to have the source list
highlight style, and expand a node that contains a node with children, the
indentation of all currently expanded nodes shifts. If the node is
collapsed, the indentation is shifted back to its original spacing.

At first I thought I was doing something wrong, but even Apple's SourceView
example has this issue. Any information on this issue would be greatly
appreciated.

Cheers,
Carmen

Video Description of the Problem: http://screencast.com/t/MzA5ZWFm
___

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


Dynamically update drawRect

2009-12-26 Thread proger proger
Hello,

I'm trying to write simple application with Core Graphics. My code:

@implementation MyView

- (id)initWithFrame:(NSRect)frameRect
{
self = [super initWithFrame:frameRect];

return self;
}

- (void)drawRect:(NSRect)rect
{
myContext = [[NSGraphicsContext currentContext]graphicsPort];
   CGContextSetRGBFillColor (myContext, 1, 0, 0, 1);// 3
   CGContextFillRect (myContext, CGRectMake (0, 0, 200, 100 ));// 4
}

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

I have two classes. One for internet connection(program logic) and one to
display graphics(i posted code). And i want to call drawRect from another
class and pass some data to drawRect method. Seems like drawRect method is
just for static graphics. Does there's any possibility to do it ? Any
examples ?
___

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: n00b Q re: AppController

2009-12-26 Thread Rob Keniger

On 25/12/2009, at 10:00 AM, David Duncan wrote:

 In Objective-C all classes share a namespace, so if two binary images are 
 loaded into the same address space, and use the same class name, then one of 
 the two classes will be used. If all of these AppControllers share the same 
 functionality, then you probably won't have any issues (for now) but if all 
 of your plugins do implement this class to the same function, then you should 
 probably abstract them all into a common framework that all of these plugins 
 load instead.


...or at the very least, change the class names of the AppController classes in 
each plug-in so they don't have the same name. AppController is a poor name for 
the main class of a plug-in anyway, as it is nothing of the sort. 
BurnerController and ProducerController would be possibilities in this case.

--
Rob Keniger



___

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: Dynamically update drawRect

2009-12-26 Thread Gideon King
DrawRect is not called directly by you - instead, you use 
setNeedsDisplayInRect: and setNeedsDisplay: to tell the system the dirty rect 
to redraw, and those rects are combined before the system locks focus on your 
view and calls drawRect:/ You therefore can't pass information to your drawing 
method - you have to use the state information you set in your program to work 
out how to draw the rects you need to draw.

HTH

Gideon 

 I have two classes. One for internet connection(program logic) and one to
 display graphics(i posted code). And i want to call drawRect from another
 class and pass some data to drawRect method. Seems like drawRect method is
 just for static graphics. Does there's any possibility to do it ? Any
 examples ?
 
___

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


dragging to trash folder problems

2009-12-26 Thread kvic...@pobox.com
i've implemented -draggedImage:endedAt:operation: and i check if the 
operation is an NSDragOperationDelete to detect drags to the trash, 
and if so, i then appropriately delete the dragged object from my 
app's document.


this all works fine as long as the user drags the object to the trash 
icon in the dock.


however, if the user drags an object to the trash icon, and then 
subsequently drags to and drops on the (popped) opened trash folder, 
i no longer receive the NSDragOperationDelete operation in 
-draggedImage:endedAt:operation: and hence cannot detect that this 
should actually be a delete and the opened trash folder remains open 
on the desktop.


not only that, but if the user drops in the (pop) opened trash 
folder, since i don't perform the delete, the user can again drag the 
same object to the trash icon in the dock and this opens a second 
trash folder. this can be repeated many times, resulting in many 
opened trash folders on the desktop.


my questions:
1) how can i detect that the user dropped into a (popped) opened trash folder?
2) is the behavior of (popping) open multiple instances of the trash 
folder a (known) bug?


this is on leopard 10.5.8.

ken
___

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: Source List Indentation Drawing Issue

2009-12-26 Thread Quincey Morris
On Dec 26, 2009, at 12:42, Carmen Cerino Jr. wrote:

 I have been having a hard time trying to track down information on this
 issue, mostly because its a rather difficult to describe. The best summary I
 can give is that if you set an NSOutlineView to have the source list
 highlight style, and expand a node that contains a node with children, the
 indentation of all currently expanded nodes shifts. If the node is
 collapsed, the indentation is shifted back to its original spacing.
 
 At first I thought I was doing something wrong, but even Apple's SourceView
 example has this issue. Any information on this issue would be greatly
 appreciated.

What it's doing in your video seems very logical. If any of the items at the 
next level are expandable, all items at that level move over so that their text 
and icons still line up vertically when the expandable items' disclosure 
triangles are drawn.

Seems like the only other alternatives would be:

1. To *always* leave room for sub-item disclosure triangles, even when none are 
shown, so that there would be wasted blank space.

2. To let the icons/text of the sub-items not align vertically, depending on 
whether they were expandable or not.

Each of those alternatives would have its own set of objections.

If you must change the default behavior (which I wouldn't recommend doing just 
because you don't like it, since consistency with other apps is probably more 
beneficial to your users) you might be able to control it by overriding 
'-[NSOutlineView frameOfOutlineCellAtRow:]', or possibly even by using a 
different value for the indentationMarkerFollowsCell property.


___

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: Dynamically update drawRect

2009-12-26 Thread Quincey Morris
On Dec 26, 2009, at 13:58, Gideon King wrote:

 DrawRect is not called directly by you - instead, you use 
 setNeedsDisplayInRect: and setNeedsDisplay: to tell the system the dirty rect 
 to redraw, and those rects are combined before the system locks focus on your 
 view and calls drawRect:/ You therefore can't pass information to your 
 drawing method - you have to use the state information you set in your 
 program to work out how to draw the rects you need to draw.
 
 HTH
 
 Gideon 
 
 I have two classes. One for internet connection(program logic) and one to
 display graphics(i posted code). And i want to call drawRect from another
 class and pass some data to drawRect method. Seems like drawRect method is
 just for static graphics. Does there's any possibility to do it ? Any
 examples ?


In any case, it seems like short-sighted design to have a view's drawing 
methods called directly by another class (even if the concept made sense in the 
Cocoa scheme of things). Rather, provide a method for other classes to call 
that specifies their rect of interest and other parameters, and have that 
method decide how to get things drawn accordingly. This might be as simple as 
stashing the parameters in instance variables and invoking '[self 
setNeedsDisplayInRect: suppliedRect]', but might also get more sophisticated if 
there might be *multiple* invocations before drawing actually occurs, in which 
case you'd have to decide how to resolve the various sets of possibly 
conflicting parameters, right?


___

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


Compile errors with Objective-C++ properties as STL/TR1 smart pointers

2009-12-26 Thread Tron Thomas
I'm running into a issue using STL/TR1 smart pointers with Objective-C++ 
properties that I think is a bug, and I wanted to get some feedback before I 
submitted any bug report.

The following code:

#import Cocoa/Cocoa.h
#import tr1/memory

class Value
{
public:
explicit Value(int amount) : m_amount(amount){}

int GetAmount() const { return m_amount; }

private:
int m_amount;
};

typedef std::tr1::shared_ptrValue ValuePtr;

@interface ValueUser : NSObject
{
@private
ValuePtr* _valuePtr;
}
- (id)initWithValue:(ValuePtr)valuePtr;
@property ValuePtr value;
@end

@implementation ValueUser
- (id)initWithValue:(ValuePtr)valuePtr
{
self = [super init];
_valuePtr = new ValuePtr(valuePtr);
return self;
}

- (void)setValue:(ValuePtr)valuePtr
{
*_valuePtr = valuePtr;
}

- (ValuePtr)value
{
return *_valuePtr;
}

- (void)dealloc
{
delete _valuePtr;
[super dealloc];
}
@end

int main()
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];

ValuePtr valuePtr(new Value(42));
ValueUser* valueUser = [[ValueUser alloc] initWithValue:valuePtr];

::NSLog(@The value's amount is %d, valueUser.value-GetAmount());

[valueUser release];

[pool release];

return 0;
}

will produce these errors on the line in the main function containing the NSLog 
call:
error: lvalue required as unary ‘’ operand
error: base operand of ‘-’ has non-pointer type ‘ValuePtr’

If I replace the line with:
::NSLog(@The value's amount is %d, [valueUser value]-GetAmount());

Everything compiles successfully.  What is the reason the '.' syntax will not 
work in this instance?

___

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: Compile errors with Objective-C++ properties as STL/TR1 smart pointers

2009-12-26 Thread Brian Bruinewoud
It's probably just a parsing thing, have you tried:
 ::NSLog(@The value's amount is %d, (valueUser.value)-GetAmount());
?


On 27/12/2009, at 11:20 , Tron Thomas wrote:

 I'm running into a issue using STL/TR1 smart pointers with Objective-C++ 
 properties that I think is a bug, and I wanted to get some feedback before I 
 submitted any bug report.
 
 The following code:
 
 #import Cocoa/Cocoa.h
 #import tr1/memory
 
 class Value
 {
 public:
explicit Value(int amount) : m_amount(amount){}
 
int GetAmount() const { return m_amount; }
 
 private:
int m_amount;
 };
 
 typedef std::tr1::shared_ptrValue ValuePtr;
 
 @interface ValueUser : NSObject
 {
 @private
ValuePtr* _valuePtr;
 }
 - (id)initWithValue:(ValuePtr)valuePtr;
 @property ValuePtr value;
 @end
 
 @implementation ValueUser
 - (id)initWithValue:(ValuePtr)valuePtr
 {
self = [super init];
_valuePtr = new ValuePtr(valuePtr);
return self;
 }
 
 - (void)setValue:(ValuePtr)valuePtr
 {
*_valuePtr = valuePtr;
 }
 
 - (ValuePtr)value
 {
return *_valuePtr;
 }
 
 - (void)dealloc
 {
delete _valuePtr;
[super dealloc];
 }
 @end
 
 int main()
 {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
 
ValuePtr valuePtr(new Value(42));
ValueUser* valueUser = [[ValueUser alloc] initWithValue:valuePtr];
 
::NSLog(@The value's amount is %d, valueUser.value-GetAmount());
 
[valueUser release];
 
[pool release];
 
return 0;
 }
 
 will produce these errors on the line in the main function containing the 
 NSLog call:
 error: lvalue required as unary ‘’ operand
 error: base operand of ‘-’ has non-pointer type ‘ValuePtr’
 
 If I replace the line with:
::NSLog(@The value's amount is %d, [valueUser value]-GetAmount());
 
 Everything compiles successfully.  What is the reason the '.' syntax will not 
 work in this instance?
 
 ___
 
 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/brian%40darknova.com
 
 This email sent to br...@darknova.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: UITextfield print to NSLog

2009-12-26 Thread Yandy Ramirez
Assuming your UITextField is an IBOutlet, simple way:

NSLog(@%@, self.myTextField.text);

you can also implement the UITextFieldDelegate and pass the textField value
as you begin editing, once it's done editing and so forth.


--
yandy


On Fri, Dec 25, 2009 at 6:49 PM, Chad Eubanks chadcreat...@gmail.comwrote:

 Hello,

 I'm working on an iPhone app and need help passing entered text from a
 UITextfield into NSLog.  Any thoughts?

 Happy Holidays,

 Chad Eubanks

 Sent from my iPhone
 ___

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

 This email sent to yan...@gmail.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: UITextfield print to NSLog

2009-12-26 Thread Yandy Ramirez
+1 on this, it's completely up to you where you want to put it.


--
yandy


On Sat, Dec 26, 2009 at 10:01 AM, David Duncan david.dun...@apple.comwrote:

 On Dec 26, 2009, at 6:58 AM, Chad Eubanks wrote:

  Yandy,
 
  Thank you for the response and info but can you please elaborate a little
 more.  Would NSLog be in my
 
  -(void)viewdidbeginediting {
  }
 


 Hard to know where you should put it, since you don't tell us what you are
 trying to accomplish. If you want to print the text in a text view, Yandy
 has told you how – but where you put it will depend on what your purpose for
 printing it is in the first place
 --
 David Duncan
 Apple DTS Animation and Printing

 ___

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

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

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

 This email sent to yan...@gmail.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: dragging to trash folder problems

2009-12-26 Thread Kyle Sluder
On Sat, Dec 26, 2009 at 5:24 PM, kvic...@pobox.com kvic...@pobox.com wrote:
 however, if the user drags an object to the trash icon, and then
 subsequently drags to and drops on the (popped) opened trash folder, i no
 longer receive the NSDragOperationDelete operation in
 -draggedImage:endedAt:operation: and hence cannot detect that this should
 actually be a delete and the opened trash folder remains open on the
 desktop.

This sounds like a bug. You should file it at
http://bugreport.apple.com. If the Dock is going to report a
drag-to-Trash as a delete operation, then the Finder should report a
drag-to-Trash-folder as a delete operation as well.

 1) how can i detect that the user dropped into a (popped) opened trash
 folder?

If you are able to drag to a folder at all, you must be providing a
file or a promise pasteboard item. In that case, you should be able to
tell if the destination folder is a Trash folder (either NSWorkspace
or some Carbon API). Then you can perform the delete.

Safari 4.0.4 is able to handle dragging bookmarks bar items to the
Trash icon in the dock as well as to a springloaded Trash folder
window.

 2) is the behavior of (popping) open multiple instances of the trash folder
 a (known) bug?

I don't think this is a bug, for the same reason that I can pop open
multiple instances of any other folder. This might not be expected
behavior for someone used to the pre-OS X Finder, but it seems pretty
consistent with the non-spatial OS X Finder.

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


[iPhone] Refreshing a UITableView in a UINavigationController...

2009-12-26 Thread Brian Bruinewoud
Hi all,

I have a navigation controller based app consisting mostly of table views.
Table View 1 moves you to Table View 2 when you select a row.
When you return from Table View 2, Table View 1 needs to be updated to show the 
changes made.
There is no fetchedResultsController for Table View 1.
I know that Table View 1 will need to be update 90% of the time.
I've done the following in Table View 1's controller:

- (void)viewDidAppear:(BOOL)animated 
{
[super viewDidAppear:animated];

if( self.beenHereBefore )
[self.tableView reloadData];

self.beenHereBefore = YES;
}

This solution seems to work.

My question is, is this the best way to do this and is this the best method to 
do it in?
Perhaps viewWillAppear is better?
Perhaps reloadData before calling super?

Thanks.

___

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


Strange Problems with IBPlugin

2009-12-26 Thread Carter Allen
Hello!

Thanks in advance, I know this is a lot to ask. I am working on a framework
of custom classes for my own personal use, and it was going very well until
I started to work on the Interface Builder plugin part. Download the
non-working code here http://c.zcr.me/7aBcU. I have think that I have done
everything necessary to make my plugin work so far (I know I haven't
programmed the backend of the inspector palette, but that shouldn't prevent
it from working. I would really appreciate it if someone could look at the
code and see what is causing my problems, as I am completely stumped. The
problem right now is that when I hit Build and Go in XCode, IB launches but
never gets past the bouncing stage. It freezes up and doesn't continue.
When I try to load the plugin normally, it gives me this
alerthttp://c.zcr.me/7aE2E.
I searched about that error, and the only people online that talk about it
are people that messed up the linking of the framework, and in all of their
cases, the plugin worked fine thru XCode.

Again, thank you for any help you can provide, I know this isn't convenient.

Sincerely,
Carter Allen
___

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


Having problems understanding NSPredicateEditor

2009-12-26 Thread Mike Chambers
I have an application that contains a NSTableView of Card data types.
The NSTableView gets its data from an NSArray of Card instances.

I want to allow the user to be able to filter the view based on the
Card fields. I know I need to use a NSPredicateEditor to present the
UI for the user, and to create the NSPredicate instances. However, I
cannot wrap my head around how this works, and cannot get a simple
example working (with a single rule). I have spent the last two days
reading up on it, and it is just not clicking for me.

So, does anyone have a very simple example of how to use
NSPredicateEditor programmatically?

I want to be able to allow the user to potentially filter on multiple
fields, but would be happy if I can get a single field to work right
now.

Here is the current predicate I am using with a NSSearchField:

NSPredicate *namePredicate = [NSPredicate
predicateWithFormat:@cardName contains[c] %@, searchString];
[filteredCards filterUsingPredicate:namePredicate];

Card has a property (NSString) named cardName.

I have tried to programmatically add a NSPredicateEditorRowTemplate,
but when I do this, nothing shows up in the editor at runtime.

NSPredicateEditorRowTemplate *template = [[NSPredicateEditorRowTemplate alloc]
 initWithLeftExpressions:[NSArray arrayWithObjects:[NSExpression
expressionForKeyPath:@cardName], nil]
rightExpressions:[NSArray arrayWithObjects:[NSExpression
expressionForConstantValue:@Foo], nil]
modifier:NSDirectPredicateModifier

  operators:[NSArray arrayWithObject:[NSNumber
numberWithInt:NSContainsPredicateOperatorType]]
options:NSCaseInsensitivePredicateOption
 ];

predicateEditor.rowTemplates = [NSArray arrayWithObject:template];

I am really stumped on this one, and would appreciate it if someone
could help nudge me in the right direction. Does anyone have a simple
example of how to construct NSPredicateEditorRowTemplate that will
create a filter like so:

cardName contains USER_INPUT

I think if I can get that working, then it will put me over the hump
and I can figure out the rest.

mike
___

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

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

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

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


Re: [iPhone] Refreshing a UITableView in a UINavigationController...

2009-12-26 Thread Luke Hiesterman
Depends on what you want for your app. If you want the user to see the  
table data change then keep it the way it is. If you'd rather the  
change occur out of view use viewWillAppear:


Luke

Sent from my iPhone.

On Dec 26, 2009, at 8:31 PM, Brian Bruinewoud br...@darknova.com  
wrote:



Hi all,

I have a navigation controller based app consisting mostly of table  
views.

Table View 1 moves you to Table View 2 when you select a row.
When you return from Table View 2, Table View 1 needs to be updated  
to show the changes made.

There is no fetchedResultsController for Table View 1.
I know that Table View 1 will need to be update 90% of the time.
I've done the following in Table View 1's controller:

- (void)viewDidAppear:(BOOL)animated
{
   [super viewDidAppear:animated];

   if( self.beenHereBefore )
   [self.tableView reloadData];

   self.beenHereBefore = YES;
}

This solution seems to work.

My question is, is this the best way to do this and is this the best  
method to do it in?

Perhaps viewWillAppear is better?
Perhaps reloadData before calling super?

Thanks.

___

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/luketheh%40apple.com

This email sent to luket...@apple.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: Compile errors with Objective-C++ properties as STL/TR1 smart pointers

2009-12-26 Thread Tron Thomas

I tried (valueUser.value)-GetAmount()) and I still get the same errors.

Date: Sun, 27 Dec 2009 11:47:35 +1100
From: Brian Bruinewoudbr...@darknova.com
Subject: Re: Compile errors with Objective-C++ properties as STL/TR1
smart   pointers
To: undisclosed-recipients: ;
Cc: cocoa-dev@lists.apple.com
Message-ID:bff7a0e2-640d-4407-bcde-38fc06046...@darknova.com
Content-Type: text/plain; charset=windows-1252

It's probably just a parsing thing, have you tried:
   

::NSLog(@The value's amount is %d, (valueUser.value)-GetAmount());
 

___

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