Re: Core Data Multiuser

2012-10-09 Thread Stefan Nobis
Flavio Donadio  writes:

> The interface will be like in Address Book: the user opens a
> card/record for viewing, but has to click an "Edit" button to make
> changes. If the record is locked, the user will get an alert when
> he/she clicks the button. I need:

> 1. A mechanism to avoid users opening records for editing and
> leaving them open "forever" (timer?);

> 2. Some kind of feedback for the users when a record is unlocked,
> without having to refresh manually.

I would not go this route. Have a look at network file systems like
Windows SMB for how ugly this can get (but maybe you can find there
some inspiration for your solution; Microsoft did quite some changes
in this area for the latest releases of the SMB protocol).

I would prefer the classic ORM optimistic locking approach: Just use a
special field in the database (e.g. a simple integer field called
"version"). On each write do something like "UPDATE ... WHERE version
= X and objectid = Y". If this fails (0 records updated), then someone
else updated the record in the meantime (between clicking on Edit and
clicking on Save) and you may present the user an error message
(maybe with the option to merge or overwrite the other changes).

In many use cases this will lead to very few messages due to record
version mismatches, there are no stale locks and the implementation is
quite simple (except for some kind of merge algorithm).

-- 
Until the next mail...,
Stefan.
___

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: What's the point of @properties?

2010-09-20 Thread Stefan Nobis
Antonio Nunes  writes:

> Maybe Stefan meant rather that the ivars do not show up in the
> debugger window.

Yes, that was the point of the question.

-- 
Until the next mail...,
Stefan.


pgpasS7cYk4A8.pgp
Description: PGP signature
___

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

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

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

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

Re: What's the point of @properties?

2010-09-20 Thread Stefan Nobis
Bill Bumgarner  writes:

> Thus, with the latest bleeding edge compiler, all you need is the
> @property() (and cleanup in -dealloc) to declare a fully KVO
> compliant attribute of your class.

Is this also supported by the debugger? In XCode 3.x I once tried to
omit the iVars but that's not very funny to debug (as it's hard to
inspect the property values without manually declared iVars).

-- 
Until the next mail...,
Stefan.


pgphvyyOqvWWh.pgp
Description: PGP signature
___

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

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

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

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

iOS and Oracle Databases

2010-08-21 Thread Stefan Nobis
Hi.

A customer is interested in utilizing the iPad. One feature request
is to get direct access to the in-house Oracle database (via VPN). I
searched a little bit but was unable to find any useful
information. Therefore I assume something like the Oracle Client
package or just liboci oder something is not available for iOS. Is
this correct or missed I something?

So I think the best way to go is via some kind of application server,
right?

-- 
Until the next mail...,
Stefan.


pgpHm4TwOfDn3.pgp
Description: PGP signature
___

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

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

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

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

Re: Understanding property/synthesize

2010-08-12 Thread Stefan Nobis
Quincey Morris  writes:

> The ability to omit the instance variable (called the "non-fragile
> instance variable" mechanism) is a feature of the latest Objective-C
> compilers and runtime, and is available for 64-bit Mac OS x64
> applications, and applications running on an iOS device.

As I observed, omitting instance variables in class declarations is
also not very well supported by the (current) debugger. So even if
backwards compatibility is of no concern, it is still a good idea to
declare the instance variables explicitly in oder to get better
debugging support.

-- 
Until the next mail...,
Stefan.


pgpp9HVlGBheX.pgp
Description: PGP signature
___

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

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

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

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

Re: Understanding property/synthesize

2010-08-09 Thread Stefan Nobis
Quincey Morris  writes:

> The ability to omit the instance variable (called the "non-fragile
> instance variable" mechanism) is a feature of the latest Objective-C
> compilers and runtime, and is available for 64-bit Mac OS x64
> applications, and applications running on an iOS device.

Ah, thanks for the explanation.

> It is not available for 32-bit or PPC applications

So if backwards compatibility is of no concern, there are chances to
get rid of quite some unnecessary code. Nice. Quite a step forward.

-- 
Until the next mail...,
Stefan.
___

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


Understanding property/synthesize

2010-08-08 Thread Stefan Nobis
Hi.

I'm a bit curious about the Objective-C 2.0 property/synthesize
mechanism. In all examples I've seen, an instance variable is declared
for each property. But if I leave out the instance variable like in
the following example, everything works fine, too.

--
#import 
#import 

@interface MyClass : NSObject
@property NSInteger number;
@end

@implementation MyClass : NSObject
@synthesize number;
@end

int main() {
  MyClass *obj = [[MyClass alloc] init];

  [obj setNumber: 77];
  printf("%d\n", (int)[obj number]);

  [obj release];
  return 0;
}
--

So my question: What are the (possible) problems/implications if I
leave out the declarations of instance variable of properties? What
are the recommendations? More specific: Does the above also work/run
on iOS?

-- 
Until the next mail...,
Stefan.
___

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