我正在尝试设置 上的“重拍”和“使用”按钮的文本PLUICameraViewController。我以编程方式浏览了视图层次结构并找到了一些UIButtonLabel对象。记录这些文本显示了我所期望的:“重新拍摄”、“取消”等。但是设置文本不起作用。这些按钮只保留其原始文本。这是我尝试过的:
if (q is a subclass of UIButtonLabel)
if ([q respondsToSelector:@selector(setText:)])
[q performSelector:@selector(setText:) withObject:@"zzz"];
Run Code Online (Sandbox Code Playgroud)
代码运行不会崩溃。respondsToSelector 也返回 YES。如何使按钮上的文本更新?
顺便说一句,我知道涉及自定义按钮、我自己的视图等的其他方法。从 Objective-C/运行时/iOS 的角度来看,我真的很好奇为什么上面的代码不起作用。
另请注意,我正在这样做
navigationController:willShowViewController:viewController:animated:
Run Code Online (Sandbox Code Playgroud) 我正在编写一个钩子来记录系统中的所有达尔文通知。我挂钩到以下功能:
CFNotificationCenterPostNotification
CFNotificationCenterPostNotificationWithOptions
NSNotificationCenter::postNotification
NSNotificationCenter::postNotificationName
Run Code Online (Sandbox Code Playgroud)
我看到很多日志。例如,当我解锁屏幕时,它会显示 SBDeviceLockStateChangedNotification。
但我期待诸如“com.apple.springboard.lockcomplete”之类的事件或类似此处的其他事件
不知道为什么我无法捕获类似达尔文的通知。任何帮助表示赞赏。这是审查的代码
#include <notify.h>
#include <substrate.h>
#include <sqlite3.h>
#include <string.h>
#import <CoreFoundation/CFNotificationCenter.h>
//#include "CPDistributedMessagingCenter.h"
#import <CoreFoundation/CoreFoundation.h>
#import <QuartzCore/QuartzCore.h>
#import <UIKit/UIKit.h>
//#import <SpringBoard/SpringBoard.h>
// init CFNotificationCenterPostNotification hook
void (*orig_CFNotificationCenterPostNotification) (
CFNotificationCenterRef center,
CFStringRef name,
const void *object,
CFDictionaryRef userInfo,
Boolean deliverImmediately
);
void replaced_CFNotificationCenterPostNotification (
CFNotificationCenterRef center,
CFStringRef name,
const void *object,
CFDictionaryRef userInfo,
Boolean deliverImmediately
){
NSLog(@"CFNotificationCenterPostNotification: %@", name );
orig_CFNotificationCenterPostNotification(center,name,object,userInfo,deliverImmediately);
}
void (*orig_CFNotificationCenterPostNotificationWithOptions) (
CFNotificationCenterRef center,
CFStringRef name,
const void …Run Code Online (Sandbox Code Playgroud) 我想使用私有/隐藏的 iOS 方法,例如clearIdleTimer来自SpringBoard类(示例here)。我该怎么做呢?许多信息引用了更旧的 iOS 版本。
这仅用于实验,我知道私有 API 未经过 App Store 批准。此外,我的 iOS 设备已注册用于开发但未越狱。
编辑:我找到了这些iOS-Runtime-Headers,但这些示例对我不起作用。
拍照时可以获取相机的曝光值(不保存为SavedPhotos).一个测光表上的iPhone应用程序这样做,可能是通过使用一些私有API.
该应用程序仅在iPhone 3GS上执行,因此我猜它可能与EXIF数据有关,在创建图像时会填充此信息.
这一切都适用于3GS.
iPhone OS 4.0有什么变化吗?现在是否有定期获取这些值的方法?
有没有人有一个工作代码示例来获取这些相机/照片设置值?
谢谢
我需要实现一个应用程序,用于在 iPhone 上接收或发送短信时检测事件。不需要读取短信。
我的应用程序将使用苹果的 VoIP 和导航器后台多任务功能在后台运行。
我可以使用私有 api,因为我的客户不需要应用商店上的这个应用程序。
谢谢。
我想知道即使应用程序在后台运行,我怎样才能在越狱ios设备上收听所有触摸事件.此功能是在名为AutoTouch的应用中实现的.任何想法或建议?
我想实现我在iOS私有API Xamarin的项目.
有人可以解释一下,我如何在Xamarin中实现以下私有API?
我想,我需要建立一个绑定的项目,但我不能得到它的工作.
在我的本机iOS项目中运行时,以下代码有效.
我的.h文件:
#import <Foundation/Foundation.h>
@interface NSURLRequest (IgnoreSSL)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString*)host;
@end
Run Code Online (Sandbox Code Playgroud)
我的.m文件:
#import "NSURLRequest+IgnoreSSL.h"
@interface NSURLRequest ()
@end
@implementation NSURLRequest (IgnoreSSL)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString*)host
{
// ignore certificate errors only for this domain
return YES;
}
@end
Run Code Online (Sandbox Code Playgroud) 我想知道当收到短信时是否可以收到短信广播。我还想检索整个正文和发件人信息。我想知道这是否可以通过私有框架而不越狱来实现。我不会出售该应用程序,它仅适用于我的个人手机,但我正在努力避免越狱猫和老鼠。
我找到了这个类PSCellularDataSettingsDetail及其方法+(void)setEnabled:(BOOL)enabled;,我认为它会给我我需要的东西,即访问移动数据设置.
我通过打开编译Preferences.framework使用找到了这个方法class-dump-z.
现在我找到了这个答案并尝试以这种方式访问类和方法,但该类也是私有的.如何打开这个类到Xcode?
好的,所以我想检测用户在iOS设备中启用热点/网络共享的天气.我可以使用私人api知道它不会进入应用程序商店.
我试图通过私人api的列表/运行时标题,但有太多,无法决定哪些可能有用.
或者我是否可以知道UIApplicationWillChangeStatusBarFrameNotification在私有api中被触发的位置(可能需要调用活动调用和激活的热点等)
我试过检测个人热点并使用CaptiveNetwork,但它只返回连接的wi-fi ssid而不是创建的热点.
任何分享的知识都会非常有帮助
更新:@creker
使用上面的代码,编译器显示错误"SCDynamicStoreCreate不可用:在iOS上不可用.所以我进入SCDynamicStore.h并更改了以下内容
SCDynamicStoreRef
SCDynamicStoreCreate (
CFAllocatorRef allocator,
CFStringRef name,
SCDynamicStoreCallBack callout,
SCDynamicStoreContext *context
) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_NA);
Run Code Online (Sandbox Code Playgroud)
至
SCDynamicStoreRef
SCDynamicStoreCreate (
CFAllocatorRef allocator,
CFStringRef name,
SCDynamicStoreCallBack callout,
SCDynamicStoreContext *context
) __OSX_AVAILABLE_STARTING(__MAC_10_1,__IPHONE_6_0);
Run Code Online (Sandbox Code Playgroud)
现在我能够获得状态1022和1023的字典.只是想通过更改这样的文件来确认(以前没做过)我将在归档构建(或任何其他问题)中存在任何问题,除此之外我们的事实知道这段代码不会进入应用程序商店
ios ×9
jailbreak ×3
iphone ×2
camera ×1
device ×1
events ×1
exif ×1
ios4 ×1
nsurlrequest ×1
objective-c ×1
sms ×1
tethering ×1
uilabel ×1
xamarin ×1
xamarin.ios ×1