 |
 | Dear Members,
Is it possible for two apps to simultaneously access microphone under iPhone. We want to develop a Skype recorder for iPhone but need to determine the possibility.
In Android we were getting problem in shared access of microphone but on Windows 7 desktop shared mode for microphone worked.
Thanks,
|
|
|
|
 | Message Automatically Removed
|
|
|
|
 | Hello!
I am new to this forum, and new to programming, although I have already reached chapter 18 of Programming in C textbook.
Please, take a look at the program I typed in from the book, and warning messages I receive. I would be grateful for explanation on what I am doing wrong. I work on Mac OS 10.7.5, Xcode 4.6.3, Terminal 2.2.3. 1) I created a file with the command: touch prog18-2.m// Program ot work with fractions - Objective-C version
2) Program #import #import
//------ @interface section ---------
@interface Fraction: Object { int numerator; int denominator; } -(void) set_numerator: (int) n; -(void) set_denominator: (int) d; -(void) print;
@end
// ----- @implementation section -------
@implementation Fraction;
// getters -(int) numerator { return numerator; }
-(int) denominator { return denominator; }
//setters -(void) set_numerator: (int) num { numerator = num; }
-(void) set_denominator: (int) denom { denominator = denom; }
//other -(void) print { printf("The value of the fraction is %i/%i\n", numerator, denominator); }
@end
//-------- program section -----------
int main(void) { Fraction* my_fract; my_fract = [Fraction new];
[my_fract set_numerator: 1]; [my_fract set_denominator: 3];
printf("The numerator is %i, and teh denominator is %i\n", [my_fract numerator], [my_fract denominator]); [my_fract print];
[my_fract free]; //frees the memory that was used by Fraction object
return 0; }
3) I compiled it with: gcc -framework Foundation prog18-2.m -o prog18-2
4) Terminal generated the following: prog18-2.m: In function ‘main’: prog18-2.m:58: warning: ‘Fraction’ may not respond to ‘+new’ prog18-2.m:58: warning: (Messages without a matching method signature prog18-2.m:58: warning: will be assumed to return ‘id’ and accept prog18-2.m:58: warning: ‘...’ as arguments.) prog18-2.m:71: warning: ‘Fraction’ may not respond to ‘-free’
Thank you!
|
|
|
|
 | 'Fraction' class is subclass of 'Object'. But 'new' method is available in 'NSObject' class. That is the reason why it its showing warnings for you.
|
|
|
|
 | Hi
I am getting the below error, when i try to compile xcode project.
duplicate symbol _squareOfDistanceBetweenPoints in:
/Users/Library/SDKs/ArcGIS/iOS/ArcGIS.framework/ArcGIS(AGSCPTUtilities.o)
/Users/project/map/libCorePlot-CocoaTouch.a(CPTUtilities.o)
duplicate symbol _niceNum in:
/Users/Library/SDKs/ArcGIS/iOS/ArcGIS.framework/ArcGIS(AGSCPTAxis.o)
/Users/project/map/libCorePlot-CocoaTouch.a(CPTAxis.o)
duplicate symbol _AddRoundedRectPath in:
/Users/Library/SDKs/ArcGIS/iOS/ArcGIS.framework/ArcGIS(AGSCPTPathExtensions.o)
/Users/project/map/libCorePlot-CocoaTouch.a(CPTPathExtensions.o)
duplicate symbol _CreateRoundedRectPath in:
/Users/Library/SDKs/ArcGIS/iOS/ArcGIS.framework/ArcGIS(AGSCPTPathExtensions.o)
/Users/project/map/libCorePlot-CocoaTouch.a(CPTPathExtensions.o)
duplicate symbol _dependentCoord in:
/Users/Library/SDKs/ArcGIS/iOS/ArcGIS.framework/ArcGIS(AGSCPTTradingRangePlot.o)
/Users/project/map/libCorePlot-CocoaTouch.a(CPTTradingRangePlot.o)
duplicate symbol _independentCoord in:
/Users/Library/SDKs/ArcGIS/iOS/ArcGIS.framework/ArcGIS(AGSCPTTradingRangePlot.o)
/Users/project/map/libCorePlot-CocoaTouch.a(CPTTradingRangePlot.o)
duplicate symbol _MyCGPathApplierFunc in:
/Users/Library/SDKs/ArcGIS/iOS/ArcGIS.framework/ArcGIS(NSCoderExtensions.o)
/Users/project/map/libCorePlot-CocoaTouch.a(NSCoderExtensions.o)
ld: 7 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
thanks in advance
|
|
|
|
 | Hi, I would like to limit the image taken to fixed size w=5 in and h=10 inch. 1. There is a way to display on screen (when taking the picture) frame in this size? 2. After taking the pic, how to enable moving the picture so the user can center the image in the 5x10 frame
Thanks!
|
|
|
|
 | I am working on XMPP based project. i am able to send message and it displays in conversation screen but when i receive message it only show in alertview not able to see in conversation screen. help me please.
- (void)viewDidLoad { [super viewDidLoad]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(messageReceived:) name:MessageRecivedNotif object:nil]; appdelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate]; [self getAllMessagesArrayWithOppositeUser:_jid]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardDidShowNotification object:nil]; } #pragma mark table delegate and datasource methods - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return data.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tblobj dequeueReusableCellWithIdentifier:@"cell"]; UILabel *lbl; if (cell==nil) { cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; if (chatLblRight == 1) { lbl = [[UILabel alloc]initWithFrame:CGRectMake(200, 10, 150, 44)]; [lbl setTextColor:[UIColor redColor]]; [cell.contentView addSubview:lbl]; } } if (chatLblRight == 1) { lbl.text = [[data objectAtIndex:indexPath.row]valueForKey:@"text"]; chatLblRight = 0; lbl = [[UILabel alloc]initWithFrame:CGRectMake(200, 10, 150, 44)]; [lbl setTextColor:[UIColor redColor]]; [cell.contentView addSubview:lbl]; return cell; } else { cell.textLabel.text=[[data objectAtIndex:indexPath.row]valueForKey:@"text"]; return cell; } } -(void)messageReceived:(NSNotification*)notif { XMPPMessage *message=(XMPPMessage*)notif.object; NSString *body = [[message elementForName:@"body"] stringValue]; NSMutableDictionary *dic_recive = [[NSMutableDictionary alloc]init]; [dic_recive setObject:body forKey:@"text"]; [data addObject:dic_recive]; chatLblRight = 1; [tblobj reloadData]; } -(IBAction)btnsend:(id)sender { [txtmsg resignFirstResponder]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.2]; [msgview setFrame:CGRectMake(0, self.view.bounds.size.height-53, self.view.bounds.size.width, 53)]; [UIView commitAnimations]; [((AppDelegate*)[[UIApplication sharedApplication]delegate]) sendMessage:txtmsg.text toUserWithJid:_jid]; NSMutableDictionary *dic_send = [[NSMutableDictionary alloc]init]; [dic_send setObject:txtmsg.text forKey:@"text"]; [data addObject:dic_send]; [tblobj reloadData]; txtmsg.text=@""; } -(NSMutableArray *)getAllMessagesArrayWithOppositeUser:(XMPPJID *)xmppUser { XMPPMessageArchivingCoreDataStorage *storage = [XMPPMessageArchivingCoreDataStorage sharedInstance]; NSManagedObjectContext *moc = [storage mainThreadManagedObjectContext]; NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@"XMPPMessageArchiving_Message_CoreDataObject" inManagedObjectContext:moc]; NSFetchRequest *request = [[NSFetchRequest alloc]init]; [request setEntity:entityDescription]; NSError *error; NSArray *messages = [moc executeFetchRequest:request error:&error]; data=[[NSMutableArray alloc] init]; @autoreleasepool { for (XMPPMessageArchiving_Message_CoreDataObject *message in messages) { if ([message.bareJid isEqual:xmppUser]) { NSMutableDictionary *dict=[[NSMutableDictionary alloc] init]; [dict setObject:message.body forKey:@"text"]; [dict setObject:message.timestamp forKey:@"date"]; if ([message isOutgoing]) { [dict setObject:@"1" forKey:@"type"]; [dict setObject:[[message.bareJidStr componentsSeparatedByString:@"@"] firstObject] forKey:@"username"]; [dict setObject:[UIColor greenColor] forKey:@"color"]; } else{ [dict setObject:@"2" forKey:@"type"]; [dict setObject:[[message.bareJidStr componentsSeparatedByString:@"@"] firstObject] forKey:@"username"]; [dict setObject:[UIColor blueColor] forKey:@"color"]; } [data addObject:dict]; } } } return data; } Where is my mistake ?
EDIT:-
- (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XMPPMessage *)message { DDLogVerbose(@"%@: %@", THIS_FILE, THIS_METHOD); [[self xmppStream] sendElement:message]; UILocalNotification *localNotification = [[UILocalNotification alloc] init]; localNotification.alertAction = @"OK"; localNotification.fireDate = [NSDate date]; localNotification.soundName = UILocalNotificationDefaultSoundName; [[UIApplication sharedApplication] presentLocalNotificationNow:localNotification]; if ([message isChatMessageWithBody]) { XMPPUserCoreDataStorageObject *user = [xmppRosterStorage userForJID:[message from] xmppStream:xmppStream managedObjectContext:[self managedObjectContext_roster]]; NSString *body = [[message elementForName:@"body"] stringValue]; NSString *displayName = [user displayName]; if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateActive) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:displayName message:body delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alertView show]; } else { UILocalNotification *localNotification = [[UILocalNotification alloc] init]; localNotification.alertAction = @"Ok"; localNotification.alertBody = [NSString stringWithFormat:@"From: %@\n\n%@",displayName,body]; [[UIApplication sharedApplication] presentLocalNotificationNow:localNotification]; } }
modified 16-Jun-15 2:45am.
|
|
|
|
 | Member 11766967 wrote: Where is my mistake ? Could be anywhere. You need to do some debugging for yourself and identify where things are going wrong. Then edit your question and add the detail to explain exactly what is or is not happening that should be. Also please put <pre></pre> tags around your code so people can read it clearly.
|
|
|
|
 | thanks for your replay. i am new in ios. can you please tell me how i check for received message? i have removed alertview from my didreceivemessage method and then i am not able to received message. i have updated my code of appdelegate.m file and method didreceivemessage. kindly replay. thanks .
|
|
|
|
 | Member 11766967 wrote: when i receive message it only show in alertview not able to see in conversation screen. help me please.
maybe I am missing something here?? In your didReceiveMessage method you are displaying an alertView when the app is active. otherwise you are displaying it as a notification.
I guess if you don't want to see it in a UIAlertView then maybe you shouldn't use that?
|
|
|
|
 | Hi Guys. I have a assignment to make a system monitor or task manager that will show all running processes. Can anyone help.
|
|
|
|
 | Member 11677967 wrote: Can anyone help. Yes, lots of people can, but you need to ask a specific question related to the work you have done. This site does not provide code to order.
|
|
|
|
|
|
|
 | // // ViewController.h // DogYears // // Created by Steven Wimer on 2/26/15. // Copyright (c) 2015 Steven Wimer. All rights reserved. // import @interface ViewController : UIViewController
@property (strong, nonatomic) IBOutlet UILabel *dogYearLabel; @property (strong, nonatomic) IBOutlet UITextField *humanYearsTextField; - (IBAction)convertButtonPressed:(UIButton *)sender;
@end
// // ViewController.m // DogYears // // Created by Steven Wimer on 2/26/15. // Copyright (c) 2015 Steven Wimer. All rights reserved. // import "ViewController.h" @interface ViewController ()
@end
@implementation ViewController - (void)viewDidLoad {
[super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (IBAction)convertButtonPressed:(UIButton *)sender
{ float humanYears = [self.humanYearsTextField.text floatValue]; float numberOfDogYears = humanYears * 7; self.dogYearLabel.text = [NSString stringWithFormat:@"%.0f years", numberOfDogYears]; } @end
/Users/SwSAS1786/Desktop/Screen Shot 2015-04-08 at 9.20.13 PM.png
/Users/SwSAS1786/Desktop/Screen Shot 2015-04-08 at 9.21.15 PM.png
|
|
|
|
 | Question??? or are is this some kind of attempt and impressing others?
|
|
|
|
|
 | Richard MacCutchan wrote: There is no such thing as a dog year
I don't think my dog can even tell time except of course that in the morning when we all leave for work it is treat time. 
|
|
|
|
 | Declare and set a variable called myName to your name Declare two more string variables introduction and japaneseIntroduction both with an NSString type Set introduction using stringWithFormat class method "My name is %@", myName Set japanese introduction using stringByAppendingString instance method by appending " to moushimasu" Print introduction and japanese introduction Step 3: Define and call a new function
Declare a function called printIntroductions The function should accept an NSString as a parameter called name Cut and paste the introduction and japaneseIntroduction code inside of the new function You should have errors for referencing 'myName'. Change any reference to 'myName' to 'name'. This is an error of scope. You only declared 'myName' in your didFinishLaunching method. Not in your new method. In your new method, you declared an argument called 'name' that your function accepts when the method is called In your didFinishLaunching method after you set myName call printIntroductions: and pass in 'myName' as an argument It should print out the introduction and Japanese introduction Step 4: Recurse through a function
Add a new function called countDownTillIntroduction: that accepts an integer called numberOfDays as an argument The function should do the following: Check to see if the numberOfDays is 0 If the number of days is 0, it should print "The time has come" If numberOfDays is not 0 It should print "[numberOfDays] days left until introductions" It should declare and set a variable oneLessDay and set it to numberOfDays - 1 It should then call countDownTillIntroduction and pass in oneLessDay In the didFinishLaunching method before you call printIntroductions call countDownTillIntroduction and pass in 4 Completion:
OUTPUT: You should see it print "4 days left until introductions", "3 days left until introductions" (down to 1) and then it should print "The time has come" and "My name is [yourName]", "[yourName] to moushimasu"
|
|
|
|
 | What is your expectation here? Do you want someone to write that program for you? That will not happen. You should try it yourself and if you then run into a specific problem, come back, ask a specific question and probably someone can help you with that.
|
|
|
|
 | Ok so be honest here.
This is codeproject.com not homeworkcheat.com. If you are having some problems and need help with a question about then ask but include the work you have completed and where you are stuck.
everyone here is and has taken the effort to learn what is they do. you should be expected to the same if you ever expect to be successful.
Learning is a part of life.
|
|
|
|
 | I think almost everybody reading a discussion board on Objective-C would be able to "solve this project".
Do you have any other questions?
|
|
|
|
 | Is it possible to design an iPad app that launches Safari, waits until a dialog box appears in Safari and then activates a button. Waits until another dialog box appears and then automatically completes the username and password in Safari and finally the app closes itself?
I cannot use Autofill as the website that Safari has accessed does not allow saving passwords. An analogy would be Safari automatically connecting to one's banks website that does not allow saving username and passwords.
This is an app I am trying to develop for visually impaired people for easy login access to the local library.
All constructive comments are welcome.
modified 8-Jan-15 18:01pm.
|
|
|
|
 | To the best of my knowledge the short answer is no.
If it were possible then I highly doubt that you would be able to get this released into the Store because of the privacy concerns that something like this could create.
If this is your app and web site then there are other alternatives available for you to try. From your app you could launch a website and pass in parameters via the url. Then on your website have some javascript that runs and takes care of what remains.
Though of course you will have the issue of passing passwords as free text via the url. Definitely requires some more more thought but alas that is for another thread. 
|
|
|
|
 | to my knowledge this is not possible. I saw some password tools (like 1Password, LastPass) on the appstore that opens up a website on an internal browser and then fill in the username and password.
But to my knowledge apple doesen't allow IPC between most of the Apps. The only place where Apps are communicating is AppleHealth where 3th party apps could write to AppleHealth.
If you find a way to opening up safari and then fill in the user and password boxes i'm extremly interested in the solution! 
|
|
|
|
 | I'm trying to make a pretty simple frontend program that's able to start up a java program when it's run, but haven't yet mastered OC. Someone suggested that I try using a console command (code below), but I haven't been able to make that work yet.
Is there an easier way to do this, or does any one here know where my code has gone wrong?
int main(int argc, constchar * argv[]) { NSFileManager *filemgr; NSString *currentpath; filemgr = [[NSFileManager alloc] init]; currentpath = [filemgr currentDirectoryPath]; NSPipe *pipe = [NSPipe pipe]; NSFileHandle *file = pipe.fileHandleForReading; NSTask *task = [[NSTask alloc] init]; task.launchPath = [currentpath stringByAppendingString:@"/java"]; task.arguments = @[@"-jar", @"PolyGlot.jar"], [NSString stringWithFormat:@"%c", argv]]; task.standardOutput = pipe; [task launch]; NSData *data = [file readDataToEndOfFile]; [file closeFile]; NSString *grepOutput = [[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding]; NSLog (@"grep returned:\n%@", grepOutput); return0; } When I run this, I get the error: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'launch path not accessible'
I know that the current path is accessible, though... so I'm kind of stumped here. Any help would be much appreciated. Thanks!
|
|
|
|
 | As a guess because what you think is the current path for the executable is not in fact the path where the jar actually is.
|
|
|
|
 | Part of the trouble I'm having here is that I'm ultimately trying to reproduce the Terminal line:
java -jar PolyGlot.jar <FILENAME_ARGUMENT >
Do you have any ideas for that? Any help would be appreciated.
|
|
|
|
 | task.launchPath = [currentpath stringByAppendingString:@"/java"]; Are you sure that the java executable is in that path? Printing out the full path at that point will tell you.
|
|
|
|
 | Ah, I do see what I was doing there! I was fundamentally misunderstanding how java was being referenced. I almost have it working at this point! Here's the code as it stands now:
int main(int argc, constchar * argv[]) { NSFileManager *filemgr; NSString *currentpath; filemgr = [[NSFileManager alloc] init]; currentpath = [filemgr currentDirectoryPath]; NSPipe *pipe = [NSPipe pipe]; NSFileHandle *file = pipe.fileHandleForReading; NSTask *task = [[NSTask alloc] init]; task.launchPath = @"/usr/bin/java"; task.arguments = @[@"-jar", [currentpath stringByAppendingString:@"/PolyGlot.jar"], [NSString stringWithFormat:@"%c", argv]]; task.standardOutput = pipe; [task launch]; NSData *data = [file readDataToEndOfFile]; [file closeFile]; NSString *grepOutput = [[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding]; NSLog (@"grep returned:\n%@", grepOutput); return0; } The only remaining problem is that the "-jar" argument seems to be ignored at this point. If I apply it by itself, Java recognizes it as an argument, but otherwise, it is only accepting "PolyGlot.jar". Is there something that I'm not doing correctly there?
Thanks for the help so far!
|
|
|
|
 | I don't know Objective-C, but I suspect that the first argument should be the same as task.launchPath , i.e the program name. That would then comply with the format of the argv array, as set by the shell when invoking programs from the command line.
|
|
|
|
 | The task.launchPath is the full path of the program to be run. Out of curiosity, I tried dropping " -jar" onto the end, but that made it fail when it looked for the executable "java -jar" rather than the executable "java" with the argument "-jar".
What's strange is that the "-jar" argument works correctly so long as it's the only one... Ultimately, the error I'm getting from Java at this point is "Could not find or load main class ". This typically appears if you try to run a .jar file without the -jar argument.
Also, just for the sake of sanity, I'll specify that I can run "java -jar PolyGlot <FILENAME>" from the console, and it runs fine.
|
|
|
|
 | DraqueD wrote: I can run "java -jar PolyGlot <FILENAME>" from the console, and it runs fine. And I think those are the fields that you need in your arguments array. The last parameter you specify should be argv[1] as a string (%s), not a character (%c), as that is the filename passed in to your program. Something like:
task.launchPath = @"/usr/bin/java"; task.arguments = @[task.launchPath, @"-jar", [currentpath stringByAppendingString:@"/PolyGlot.jar"], [NSString stringWithFormat:@"%s", argv[1]]];
|
|
|
|
 | As a heads up, I found my solution! It turns out that the debug folder that this was running in gave Java particular troubles, and the behavior cleared up when I took my compiled app into a typical folder. Thanks to everyone who replied for the help!
|
|
|
|
 | I think there is an problem in executable path..Check out that
|
|
|
|
 | We've just completed an iOS app called Waffle which is launching in the new year and are looking for Node.js developers to join our team.
Waffle is a a community for you to share your thoughts & learn from the world around you. Jump into group chats with people who share your interests and enjoy fast, flowing conversations on the things you’re passionate about.
We have a 3 strong team with backgrounds working for Microsoft. EASA and are looking for hard working and passionate developers either part or full time.
If you're interested please email sharan@waffleapp.co
Sharan
|
|
|
|
 | In objective-c I’m try to create a statement that toggles a variable that switches between two numbers with a UIswitch controller (a * b/w * r) c * h; r needs to trigger two different numbers when on needs to = .73 when off needs to = .66 int a=1; int b=5.14; int c = -.015; int w =1; int r =.73;// on=.73 and off= .66 int h=1; int result;
result = (a * b/w * r) c * h; NSLog (@"a*b/w*r)c*h;"); Is this possible
|
|
|
|
 | Member 11251240 wrote: Is this possible Most likely but your question is far from clear. In general terms you would write something like:
if (switch == ON) r = .73; else r = .66; But maybe I just don't understand what you are asking.
|
|
|
|
 | What is the core difference between C programming language and Objective-C programming language? Please help me to know with suitable examples. A lot of Thanks in Advance.
Regards Online Visit
online visit
|
|
|
|
 | C and Objective-C have many differences. First of all, C is procedure-oriented language while object-C is object-oriented language. They have different syntaxes. Objective-C is more familiar to smalltalk than C/C++. e.g. of calling method c: foo(param1, para2, ...); objective-c: [object foo:param]; There are many differences between two languages.

jian
|
|
|
|
 | thanks sir, but i need some real life example to clear this concept more.
Regards Online Visit
|
|
|
|
 | Google will find you lots of documentation on both languages.
|
|
|
|
|
 | I don't think so. It's quite reasonable to want to learn the differences, just a pity he/she (like so many others) can't make the effort to do a bit of research.
|
|
|
|
 | Nothing wrong with his question. But I checked his user id, signature in his message & links in his profile so thought ....
|
|
|
|
 | after looking at his signature I am thinking the same thing about this being spam now.
|
|
|
|
 | I disagree, the question has nothing in it that could be construed as spam. And there are quite a few members who have links to their own business in their signatures.
|
|
|
|
|
|