可能重复:
Android看似无用的调试环境
我显然被Visual Studio宠坏了,因为虽然我只是在学习Android和Eclipse环境,但在Eclipse中调试应用程序正在成为进一步开发的严重损害.
例如,Eclipse会将这个除以零编译得很好:
public class Lesson2Main extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate (savedInstanceState);
int i = 1 / 0;
TextView tv = new TextView (this);
tv.setText ("Hello, Android!");
setContentView (tv);
}
}
Run Code Online (Sandbox Code Playgroud)
然后,当它在调试器下执行时,我将获得一个无用的调试信息的全屏,其中没有实际指向包含错误的特定行.
stackTrace在异常('e')信息树中为空,它只是声明一条消息,指出'ArithmeticException'.(那很好,你怎么指向我找到它的方向!?)
我看了整个屏幕,我很困惑,这个IDE无法做到这一点.使用Eclipse进行开发是否会让所有人回到1991年,而printf()就像每个时间间隔记录一样,然后追踪错误?认真.
是否有我缺少的配置或插件来帮助解决这个问题?
我没有用XCode测试过这种情况,但是如果iPhone开发了.IDE处理这个更像Visual Studio,然后难怪Android市场有这么少的应用程序.
我对Android很兴奋,但似乎Eclipse正在阻碍它.
使用:C#,VS2008
我有以下主要表单类:
[Main.cs]
namespace Server
{
public partial class PipeServerform : System.Windows.Forms.Form
{
...
}
}
Run Code Online (Sandbox Code Playgroud)
但它很长很长,并且包含GUI +逻辑代码.
因此,我将该类分成多个文件以便于管理,并创建仅保存逻辑详细信息的文件:
[DoCommands.cs]
namespace Server
{
public partial class PipeServerform : System.Windows.Forms.Form
{
...
}
}
Run Code Online (Sandbox Code Playgroud)
这有效...... 但是!VS2008项目中 的" DoCommands.cs "文件现在具有与之关联的默认空白GUI"窗体"窗口.
这是有意义的,因为它仍然是主要表单类的一部分,但我认为不同文件之间的分离会告诉VS2008它只是简单命令的逻辑文件持有者,并且不包含任何GUI表单代码.
有没有简单的方法来解决这个问题?这样' DoCommands.cs '文件没有与之相关的空白GUI表单?
或者我是否必须将它分成不同的类?
谢谢.
我用来(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)对每个输入的字符进行实时正则表达式验证UITextView.
这很好用,甚至可以处理可能包含无效字符的粘贴文本.
但是,Siri似乎并不关心这些事情并将其直接转发(void)textViewDidChange:(UITextView *)theTextView,绕过shouldChangeTextInRange代表并避免验证检查.
这对我来说似乎是一个安全漏洞,并打破了每个其他输入通道所遵循的API流程.
有关如何让Siri Dictation遵守呼叫的任何想法shouldChangeTextInRange?
我看到很多用于.NET的用户界面控件库,但是我在哪里可以使用简单的C/C++获得win32的相似内容?
比较漂亮的按钮,拨号,列表视图,图表等等.
似乎每个Win32程序员的通行权都是最终编写自己的集合.:/
请不要MFC控制.我只做纯C/C++.说到这一点,我也不想在我的应用程序中添加一个多兆字节的框架,这样我就可以拥有一个更漂亮的按钮.
我为遗漏一个小细节而道歉,那就是我的开发适用于Windows Mobile.
所以清单文件已经出来了.
我只是注意到有多少开发公司疯狂制作漂亮的.NET组件,并想知道等效的C/C++ Win32组件在哪里?
我读到有多少人最终编写了自己的渐变按钮类等等.所以你会认为这些东西会有一些商业类.这很奇怪.
我将仔细研究QT并研究它对这些东西的GUI支持.当你是自己的uISV中的那个人时,这就是挑战.没有其他开发人员帮助您"完成任务".
工具/环境:C++,VS2008,WM6.1
我目前只有可用于测试的HTC Diamond Windows Mobile手机,并尽可能地尝试,凭借我的所有黑客实力,我仍然无法完成获取Cell ID和LAC剩余细节的任务,以完成我的基于蜂窝位置的程序.
我设法获得了MCC和MNC,但Cell ID和LAC号码仍然隐藏在我身上.还有必须要得到这些,本身无疑是它们用于其他事情手机的方式. :/
重申我所尝试的,它将是以下内容:
RIL_GetCellTowerInfo (g_hRIL); // doesn't even signal the 'ResultCallback' function.
RIL_GetCurrentOperator (g_hRIL, RIL_OPFORMAT_NUM); // calls the 'ResultCallback' function and only with this am I able to at least get the MCC and MNC.
Run Code Online (Sandbox Code Playgroud)
尝试了以下测试代码,没有任何效果.
//constants and structures for cell ID
#define RIL_DEVSPECIFICPARAM_ENABLECELLIDSUPPORT 26
#define RIL_DEVSPECIFICPARAM_DISABLECELLIDSUPPORT 27
bool mode = true;
DWORD dwFuncID=0;
if (mode)
dwFuncID = RIL_DEVSPECIFICPARAM_ENABLECELLIDSUPPORT;
else
dwFuncID = RIL_DEVSPECIFICPARAM_DISABLECELLIDSUPPORT;
m_hrCellIdRequest_ = RIL_DevSpecific (g_hRIL,(LPBYTE) …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用GCDAsyncSocket一个简单的例子,并且发现我缺少某些理解,并希望你们好,人们可以帮助解释这一点.
我在下面设置了GCDAsyncSocket:
dispatch_queue_t mainQueue = dispatch_get_main_queue();
asyncSocket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:mainQueue];
NSString *host = @"192.168.169.132";
uint16_t port = 2112;
DDLogInfo(@"Connecting to \"%@\" on port %hu...", host, port);
self.viewController.label.text = @"Connecting...";
NSError *error = nil;
if (![asyncSocket connectToHost:host onPort:port withTimeout:5.0 error:&error])
{
DDLogError(@"Error connecting: %@", error);
self.viewController.label.text = @"Oops";
}
else
{
DDLogVerbose(@"Connecting...");
}
- (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(UInt16)port
{
DDLogInfo(@"socket:%p didConnectToHost:%@ port:%hu", sock, host, port);
self.viewController.label.text = @"Connected";
// We're just going to send a test string to …Run Code Online (Sandbox Code Playgroud) 经过无数次的尝试和筛选每个SO答案+谷歌搜索结果后,让我感到困惑的是,在iOS上使用EXIF是如此令人沮丧.
下面是工作代码及其结果.
[[self stillImageOutput] captureStillImageAsynchronouslyFromConnection:videoConnection
completionHandler:^(CMSampleBufferRef imageSampleBuffer, NSError *error)
{
NSData *imageNSData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer];
CGImageSourceRef imgSource = CGImageSourceCreateWithData((__bridge_retained CFDataRef)imageNSData, NULL);
//get all the metadata in the image
NSDictionary *metadata = (__bridge NSDictionary *)CGImageSourceCopyPropertiesAtIndex(imgSource, 0, NULL);
NSLog(@"original metadata Info: %@",metadata);
//make the metadata dictionary mutable so we can add properties to it
NSMutableDictionary *metadataAsMutable = [metadata mutableCopy];
NSMutableDictionary *EXIFDictionary = [[metadataAsMutable objectForKey:(NSString *)kCGImagePropertyExifDictionary]mutableCopy];
NSMutableDictionary *GPSDictionary = [[metadataAsMutable objectForKey:(NSString *)kCGImagePropertyGPSDictionary]mutableCopy];
NSMutableDictionary *RAWDictionary = [[metadataAsMutable objectForKey:(NSString *)kCGImagePropertyRawDictionary]mutableCopy];
if(!EXIFDictionary)
EXIFDictionary = [[NSMutableDictionary dictionary] …Run Code Online (Sandbox Code Playgroud) 我正在调试一个示例教程片段,并对设置器的覆盖感到困惑.
我声明并覆盖如下所示:
//
// PolygonShape.h
//
@interface PolygonShape : NSObject
{
int numberOfSides;
}
@property int numberOfSides;
//
// PolygonShape.m
//
@synthesize numberOfSides;
// custom setter.
- (void) setnumberOfSides:(int) i
{
if ((i > minimumNumberOfSides) && (i <= maximumNumberOfSides))
numberOfSides = i;
else
NSLog (@"Number of sides outside limits:\n You entered %d, limits are min.:%d, max.:%d",
i, minimumNumberOfSides+1, maximumNumberOfSides);
}
//
// main.m
//
poly = [[PolygonShape alloc] init];
poly.numberOfSides = 2;
[poly setnumberOfSides:2];
Run Code Online (Sandbox Code Playgroud)
所以我的假设是,因为我" 覆盖 "合成的setter numberOfSides,然后poly.numberOfSides …
就这么简单.
跑狮子.
已验证的编译器设置为"LLVM 4.0".
然后我做了相同的测试,但在XCode 4.4中创建了一个新项目,瞧!自动@synthesize在4.4项目中工作.
汽车@synthesize 也似乎对工作新添加到代码属性.但现有的旧版本会产生错误.
还有其他人经历过吗?还有其他我需要检查的东西吗?
我真的希望自动生成功能能够正常工作.
谢谢.