|
hi all,
when i trying to print or preview multiple pages from my application
i got this
exception
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Printing failed because PMSessionEndDocumentNoDialog() returned -30871.'
i really don't understand
what can i do here.
in printing i pass an image creating from rendering of my customise view.
please help me for this.
if there is a one page its working fine
but when i create different image at time of printing its crash
crash log:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread: 7
Application Specific Information:
abort() called
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Printing failed because PMSessionEndDocumentNoDialog() returned -30871.'
Thread 7 Crashed:
0 libSystem.B.dylib 0x00007fff837d59ce __semwait_signal_nocancel + 10
1 libSystem.B.dylib 0x00007fff837d58d0 nanosleep$NOCANCEL + 129
2 libSystem.B.dylib 0x00007fff838323ce usleep$NOCANCEL + 57
3 libSystem.B.dylib 0x00007fff83851a00 abort + 93
4 libstdc++.6.dylib 0x00007fff8791f5d2 __tcf_0 + 0
5 libobjc.A.dylib 0x00007fff8116cb39 _objc_terminate + 100
6 libstdc++.6.dylib 0x00007fff8791dae1 __cxxabiv1::__terminate(void (*)()) + 11
7 libstdc++.6.dylib 0x00007fff8791db16 __cxxabiv1::__unexpected(void (*)()) + 0
8 libstdc++.6.dylib 0x00007fff8791dbfc __gxx_exception_cleanup(_Unwind_Reason_Code, _Unwind_Exception*) + 0
9 libobjc.A.dylib 0x00007fff81168fa2 object_getIvar + 0
10 com.apple.CoreFoundation 0x00007fff800b45d7 +[NSException raise:format:arguments:] + 103
11 com.apple.CoreFoundation 0x00007fff800b4564 +[NSException raise:format:] + 148
12 com.apple.AppKit 0x00007fff8556086e -[NSPrintSpoolingGraphicsContext dealloc] + 37
13 com.apple.CoreFoundation 0x00007fff80030fc3 __CFArrayReleaseValues + 435
14 com.apple.CoreFoundation 0x00007fff8000eaa3 _CFRelease + 179
15 com.apple.AppKit 0x00007fff8500b53d __NSAppKitFinalizeThreadData + 260
16 libSystem.B.dylib 0x00007fff8379c751 _pthread_tsd_cleanup + 187
17 libSystem.B.dylib 0x00007fff8379c39c _pthread_exit + 147
18 com.apple.Foundation 0x00007fff83bd227f __NSFinalizeThreadData + 0
19 com.apple.Foundation 0x00007fff83bd2217 __NSThread__main__ + 1448
20 libSystem.B.dylib 0x00007fff8379bfd6 _pthread_start + 331
21 libSystem.B.dylib 0x00007fff8379be89 thread_start + 13
..
please help
modified 5-Apr-17 8:11am.
|
|
|
|
|
Before the task finish r u sending another image to print. The error seems to be like this. In case of multiple images all images should be in a queue , First come first serve. Till one job is not done . another image should wait.
|
|
|
|
|
i send image to printing one by one ,this happens when page is change to second page
on single page it print multiple images without any problem.
|
|
|
|
|
I want to get the magnetic induction intensity, light intensity, the object distance phone
|
|
|
|
|
|
hi all,
i have an image with god quality even when i view it in preview and zoom its gud and not pixelate.
i have create an custom view class derived from NSView, to draw text above and below the image. and resize the image
inside the custom view class in -drawRect method, i draw the text and image.
with help of NSMutableAttributedString drawinRect and NSImage drawInRect methods.
than get final image like this.
<pre lang="objc">
OffscreenView *view = [[OffscreenView alloc] initWithImage:myimage];
NSRect rect = [view bounds];
NSData *data = [view dataWithPDFInsideRect:rect];
NSImage *image_bar = [[NSImage alloc] initWithData:data];
buts this image quality is very badges compare to original image i pass to view.
please help me to get god quality image here.
modified 17-Jan-17 1:09am.
|
|
|
|
|
does it compressing the image volume as well .
|
|
|
|
|
|
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,
|
|
|
|
|
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 <stdio.h>
#import <objc object.h="">
//------ @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!
|
|
|
|
|
how in this way
What could explain to me
|
|
|
|
|
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 <uikit uikit.h="">
@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?
|
|
|
|