小编use*_*731的帖子

使用CGImageProperties获取EXIF属性

我希望能够在JPEG的元数据中添加文本注释,并能够从iphone应用程序中读取它.

我认为这很简单,因为ios4包含对EXIF信息的支持.所以我使用一个名为used AnalogExif的Windows工具添加元数据,并使用以下方法从我的应用程序中读回:

NSData *jpeg = UIImageJPEGRepresentation(myUIImage,1.0);

CGImageSourceRef  source = CGImageSourceCreateWithData((CFDataRef)jpeg, NULL);
NSDictionary *metadata = (NSDictionary *) CGImageSourceCopyPropertiesAtIndex(source,0,NULL);

NSMutableDictionary *metadataAsMutable = [[metadata mutableCopy]autorelease];
[metadata release];

NSMutableDictionary *EXIFDictionary = [[[metadataAsMutable objectForKey:(NSString *)kCGImagePropertyExifDictionary]
Run Code Online (Sandbox Code Playgroud)

这有用......到了一点:)

我在元数据字典中得到的是:

(gdb) po metadata
{
   ColorModel = RGB;
   Depth = 8;
   Orientation = 1;
   PixelHeight = 390;
   PixelWidth = 380;
   "{Exif}" =     {
      ColorSpace = 1;
      PixelXDimension = 380;
      PixelYDimension = 390;
   };
   "{JFIF}" =     {
      DensityUnit = 0;
      JFIFVersion = (
        1,
        1
      );
      XDensity = 1; …
Run Code Online (Sandbox Code Playgroud)

xcode iptc exif uiimage cgimagesource

5
推荐指数
1
解决办法
3586
查看次数

从chid UIView访问父视图

我有一个带有xib的UIViewController并使用Interface Builder我添加了一个子UIView.在子UIView中,当我点击该视图中的一个对象时,我希望能够改变整个窗口的标题.

现在我通常会做那个设置

self.title = @"hi";
Run Code Online (Sandbox Code Playgroud)

在父UIViewController上.但有什么方法可以从孩子内部访问父母标题?

我试过了

self.superview.title = @"i";
self.parentViewController.title = @"hi";
Run Code Online (Sandbox Code Playgroud)

但都没有工作.任何帮助非常感谢

谢谢

xcode view title uiviewcontroller uiview

5
推荐指数
1
解决办法
2万
查看次数

performSelectorOnMainThread导致"无法识别的选择器发送到实例"

首先感谢您抽出时间查看这个问题.

我正在尝试创建一个非常简单的UIViewController示例,我在一个线程中加载数据.线程被调用但是从那个线程,我无法回到主线程.下面的测试用例非常简单,我在XCode中创建了一个基于View的应用程序,并添加了NSOperationQueue代码.希望有人可以快速发现我的男生错误:)

代表很简单,.h是:

#import<UIKit/UIKit.h>

@class ViewbasedViewController;

@interface ViewbasedAppDelegate : NSObject <UIApplicationDelegate> {
 UIWindow *window;
 ViewbasedViewController *viewController;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet ViewbasedViewController *viewController;
@end
Run Code Online (Sandbox Code Playgroud)

而.m同样简单:

#import "ViewbasedAppDelegate.h"
#import "ViewbasedViewController.h"
@implementation ViewbasedAppDelegate
@synthesize window;
@synthesize viewController;

#pragma mark -
#pragma mark Application lifecycle

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {        
 // Override point for customization after application launch.
 // Set the view controller as the window's root view controller and display.
 self.window.rootViewController = self.viewController;
 [self.window makeKeyAndVisible]; …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c uitableview nsoperationqueue

2
推荐指数
1
解决办法
2908
查看次数