feb 12

Hoy vengo con un pequeño ejemplo de código para crear claves GUID (o UUID) en el iPhone que puede ser útil en muchos proyectos.

Para eso usaremos la clase CFUUID.
Aquí dejo un ejemplo comleto de un método que se encargaría de crear y devolver en un string el GUID:

+(NSString *)getGUID{
CFUUIDRef	uuidObj = CFUUIDCreate(nil);
NSString *str = (NSString*)CFUUIDCreateString(nil, uuidObj);
CFRelease(uuidObj);
[str autorelease];
return str;
}
VN:F [1.9.8_1114]
Rating: 0.0/5 (0 votes cast)
VN:F [1.9.8_1114]
Rating: 0 (from 0 votes)

2 Responses to “¿Como generar GUID / UUID en el iPhone?”

  1. Paulina Paulina dice:

    Para que sirve esto??? yo necesito controlar el bluetooth del iphone para que quede siempre como servidor y este checando si le llega una señal determinada para que solo de esa señal reciba datos

    VA:F [1.9.8_1114]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.8_1114]
    Rating: 0 (from 0 votes)
  2. Sirve para generar identificadores únicos. Los identificadores únicos pueden ser útiles para mil cosas.
    Para controlar el bluetooth tendrías que buscar artículos sobre el tema.

    VN:F [1.9.8_1114]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.8_1114]
    Rating: 0 (from 0 votes)

Leave a Reply

*
preload preload preload